diff --git a/include/boost/bind.hpp b/include/boost/bind.hpp index bd14c1d..bece8a7 100644 --- a/include/boost/bind.hpp +++ b/include/boost/bind.hpp @@ -1159,20 +1159,41 @@ BOOST_BIND_OPERATOR( >=, greater_equal ) #endif +// visit_each, ADL + +#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ ) + +template void visit_each( V & v, value const & t, int ) +{ + using boost::visit_each; + BOOST_BIND_VISIT_EACH( v, t.get(), 0 ); +} + +template void visit_each( V & v, bind_t const & t, int ) +{ + t.accept( v ); +} + +#endif + } // namespace _bi -// visit_each +// visit_each, no ADL -template void visit_each(V & v, _bi::value const & t, int) +#if defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) || defined( __BORLANDC__ ) + +template void visit_each( V & v, _bi::value const & t, int ) { - BOOST_BIND_VISIT_EACH(v, t.get(), 0); + BOOST_BIND_VISIT_EACH( v, t.get(), 0 ); } -template void visit_each(V & v, _bi::bind_t const & t, int) +template void visit_each( V & v, _bi::bind_t const & t, int ) { - t.accept(v); + t.accept( v ); } +#endif + // bind #ifndef BOOST_BIND diff --git a/include/boost/bind/bind_template.hpp b/include/boost/bind/bind_template.hpp index 5aac196..b2c295d 100644 --- a/include/boost/bind/bind_template.hpp +++ b/include/boost/bind/bind_template.hpp @@ -206,6 +206,11 @@ template void accept(V & v) const { +#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ ) + + using boost::visit_each; + +#endif BOOST_BIND_VISIT_EACH(v, f_, 0); l_.accept(v); } diff --git a/test/bind_visit_test.cpp b/test/bind_visit_test.cpp index c2b8089..5fd8e88 100644 --- a/test/bind_visit_test.cpp +++ b/test/bind_visit_test.cpp @@ -22,6 +22,7 @@ #endif #include +#include #if defined(BOOST_MSVC) && (BOOST_MSVC < 1300) # pragma warning(pop) @@ -37,12 +38,14 @@ struct visitor { } - template void operator()( T const & /*t*/ ) + template void operator()( T const & t ) { + std::cout << "visitor::operator()( T ): " << typeid( t ).name() << std::endl; } void operator()( int const & t ) { + std::cout << "visitor::operator()( int ): " << t << std::endl; hash = hash * 10 + t; } };