From c69a4ad382a202fffb74913ee089b10f3c4bcca1 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 21 Apr 2006 13:14:58 +0000 Subject: [PATCH] Fixed a visit_each-related bug exposed by strict two-phase lookup [SVN r33761] --- include/boost/bind.hpp | 31 +++++++++++++++++++++++----- include/boost/bind/bind_template.hpp | 5 +++++ 2 files changed, 31 insertions(+), 5 deletions(-) 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); }