Update of /cvsroot/boost/boost/libs/bind
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8425
Modified Files:
bind_visitor.cpp
Log Message:
Fixed to compile
Index: bind_visitor.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/bind/bind_visitor.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- bind_visitor.cpp 26 Jul 2004 00:32:08 -0000 1.4
+++ bind_visitor.cpp 4 Apr 2007 21:30:32 -0000 1.5
@@ -31,32 +31,18 @@
#pragma warning(pop)
#endif
-// default implementation of visit_each
-
-namespace boost
-{
- template<class V, class T> void visit_each(V & v, T const & t, long)
- {
- v(t, 0);
- }
-}
-
-// visitor
-
-int hash = 0;
+//
struct visitor
{
- template<class T> void operator()(boost::reference_wrapper<T> const & r,
int) const
+ template<class T> void operator()( boost::reference_wrapper<T> const & r )
const
{
std::cout << "Reference to " << typeid(T).name() << " @ " << &r.get()
<< " (with value " << r.get() << ")\n";
- hash += r.get();
}
- template<class T> void operator()(T const &, long) const
+ template<class T> void operator()( T const & t ) const
{
- std::cout << "Value of type " << typeid(T).name() << '\n';
- ++hash;
+ std::cout << "Value of type " << typeid(T).name() << " (with value "
<< t << ")\n";
}
};
@@ -70,26 +56,10 @@
int x = 2;
int y = 7;
-int detect_errors(bool x)
-{
- if(x)
- {
- std::cerr << "no errors detected.\n";
- return 0;
- }
- else
- {
- std::cerr << "test failed.\n";
- return 1;
- }
-}
-
int main()
{
using namespace boost;
visitor v;
visit_each(v, bind<int>(bind(f, ref(x), _1, 42), ref(y)), 0);
-
- return detect_errors(hash == 12);
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs