diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index cd3a579..c297847 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -674,29 +674,6 @@ public: } } -#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3 - // GCC 3.3 and newer cannot copy with the global operator==, due to - // problems with instantiation of function return types before it - // has been verified that the argument types match up. - template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) - operator==(Functor g) const - { - if (const Functor* fp = target()) - return function_equal(*fp, g); - else return false; - } - - template - BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) - operator!=(Functor g) const - { - if (const Functor* fp = target()) - return !function_equal(*fp, g); - else return true; - } -#endif - public: // should be protected, but GCC 2.95.3 will fail to allow access detail::function::vtable_base* get_vtable() const { return reinterpret_cast( @@ -785,10 +762,9 @@ template } #else -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) // Comparisons between boost::function objects and arbitrary function -// objects. GCC 3.3 and before has an obnoxious bug that prevents this -// from working. +// objects. + template BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) operator==(const function_base& f, Functor g) @@ -824,7 +800,6 @@ template return !function_equal(g, *fp); else return true; } -# endif template BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool) diff --git a/test/contains_test.cpp b/test/contains_test.cpp index 91e10ab..f317364 100644 --- a/test/contains_test.cpp +++ b/test/contains_test.cpp @@ -108,10 +108,8 @@ static void equal_test() f = &forty_two; BOOST_CHECK(f == &forty_two); BOOST_CHECK(f != ReturnInt(17)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two == f); BOOST_CHECK(ReturnInt(17) != f); -#endif BOOST_CHECK(f.contains(&forty_two)); @@ -119,11 +117,9 @@ static void equal_test() BOOST_CHECK(f != &forty_two); BOOST_CHECK(f == ReturnInt(17)); BOOST_CHECK(f != ReturnInt(16)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two != f); BOOST_CHECK(ReturnInt(17) == f); BOOST_CHECK(ReturnInt(16) != f); -#endif BOOST_CHECK(f.contains(ReturnInt(17))); @@ -131,11 +127,9 @@ static void equal_test() BOOST_CHECK(f != &forty_two); BOOST_CHECK(f == contain_test::ReturnIntFE(17)); BOOST_CHECK(f != contain_test::ReturnIntFE(16)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two != f); BOOST_CHECK(contain_test::ReturnIntFE(17) == f); BOOST_CHECK(contain_test::ReturnIntFE(16) != f); -#endif BOOST_CHECK(f.contains(contain_test::ReturnIntFE(17))); @@ -145,20 +139,16 @@ static void equal_test() g = &forty_two; BOOST_CHECK(g == &forty_two); BOOST_CHECK(g != ReturnInt(17)); -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two == g); BOOST_CHECK(ReturnInt(17) != g); -# endif g = ReturnInt(17); BOOST_CHECK(g != &forty_two); BOOST_CHECK(g == ReturnInt(17)); BOOST_CHECK(g != ReturnInt(16)); -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(&forty_two != g); BOOST_CHECK(ReturnInt(17) == g); BOOST_CHECK(ReturnInt(16) != g); -# endif #endif } @@ -175,10 +165,8 @@ static void ref_equal_test() BOOST_CHECK(!(f != boost::ref(ri))); BOOST_CHECK(!(f != ri)); BOOST_CHECK(!(boost::ref(ri) != f)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(ri == f); BOOST_CHECK(!(ri != f)); -#endif // Values equal, references inequal ReturnInt ri2(17); @@ -188,10 +176,8 @@ static void ref_equal_test() BOOST_CHECK(!(f != ri2)); BOOST_CHECK(!(f == boost::ref(ri2))); BOOST_CHECK(!(boost::ref(ri2) == f)); -#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(ri2 == f); BOOST_CHECK(!(ri2 != f)); -#endif } #if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX) @@ -206,10 +192,8 @@ static void ref_equal_test() BOOST_CHECK(!(f != boost::ref(ri))); BOOST_CHECK(!(f != ri)); BOOST_CHECK(!(boost::ref(ri) != f)); -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(ri == f); BOOST_CHECK(!(ri != f)); -# endif // Values equal, references inequal ReturnInt ri2(17); @@ -219,10 +203,8 @@ static void ref_equal_test() BOOST_CHECK(!(f != ri2)); BOOST_CHECK(!(f == boost::ref(ri2))); BOOST_CHECK(!(boost::ref(ri2) == f)); -# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3) BOOST_CHECK(ri2 == f); BOOST_CHECK(!(ri2 != f)); -# endif } #endif }