From 4466a7c9c0500d749edec26a81d6e0ce025f6184 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sun, 15 Dec 2002 14:45:13 +0000 Subject: [PATCH] function_base.hpp: - GCC 3.0 and later do support enable_if. Not sure what happened there... - Use BOOST_WORKAROUND in some places (more to come...) [SVN r16612] --- include/boost/function/function_base.hpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/boost/function/function_base.hpp b/include/boost/function/function_base.hpp index 58b44ec..e8f318e 100644 --- a/include/boost/function/function_base.hpp +++ b/include/boost/function/function_base.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG) # define BOOST_FUNCTION_TARGET_FIX(x) x @@ -42,9 +43,8 @@ namespace boost { namespace python { namespace objects { }}} #endif -// GCC 3.2 doesn't seem to support enable_if, so we assume that -// earlier versions have the same limitation -#if defined(__GNUC__) && __GNUC__ < 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ <= 2 ) && !(BOOST_STRICT_CONFIG) +// GCC 2.95.3 (or earlier) doesn't support enable_if +#if BOOST_WORKAROUND(__GNUC__, < 3) # define BOOST_FUNCTION_NO_ENABLE_IF #endif @@ -284,6 +284,12 @@ namespace boost { } }; +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + template struct enable_if; + + template struct enable_if { typedef T type; }; + template struct enable_if {}; +#else # if defined(BOOST_STRICT_CONFIG) || !defined(__HP_aCC) || __HP_aCC > 33900 template # else @@ -311,6 +317,8 @@ namespace boost { struct enable_if : public enabled::template base { }; +#endif + } // end namespace function } // end namespace detail