From 9cfe194f80fdda204f6128971cc18698e0c6c4e5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 26 Apr 2005 20:31:35 +0000 Subject: [PATCH] Fix g++ 2.9x ambiguity caused by std::rel_ops operators. [SVN r28493] --- include/boost/bind.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/boost/bind.hpp b/include/boost/bind.hpp index 5c203ed..3eba772 100644 --- a/include/boost/bind.hpp +++ b/include/boost/bind.hpp @@ -1178,6 +1178,27 @@ BOOST_BIND_OPERATOR( >=, greater_equal ) #undef BOOST_BIND_OPERATOR +#if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3) + +// resolve ambiguity with rel_ops + +#define BOOST_BIND_OPERATOR( op, name ) \ +\ +template \ + bind_t< bool, name, list2< bind_t, bind_t > > \ + operator op (bind_t const & f, bind_t const & g) \ +{ \ + typedef list2< bind_t, bind_t > list_type; \ + return bind_t ( name(), list_type(f, g) ); \ +} + +BOOST_BIND_OPERATOR( !=, not_equal ) +BOOST_BIND_OPERATOR( <=, less_equal ) +BOOST_BIND_OPERATOR( >, greater ) +BOOST_BIND_OPERATOR( >=, greater_equal ) + +#endif + } // namespace _bi // visit_each