From da9d12d1b9cab96b25b65c3b6c582b98f2f8b3e7 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sun, 15 Dec 2002 14:51:16 +0000 Subject: [PATCH] function_template.hpp: - When enable_if is not supported, supply an int version of the constructor and assignment operator so that the '= 0' or construct-with-0 syntax is usable [SVN r16613] --- include/boost/function/function_template.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/function/function_template.hpp b/include/boost/function/function_template.hpp index e90f468..3d4c72c 100644 --- a/include/boost/function/function_template.hpp +++ b/include/boost/function/function_template.hpp @@ -295,7 +295,9 @@ namespace boost { #ifndef BOOST_FUNCTION_NO_ENABLE_IF BOOST_FUNCTION_FUNCTION(clear_type*) : function_base(), invoker(0) {} -#endif // BOOST_FUNCTION_NO_ENABLE_IF +#else + BOOST_FUNCTION_FUNCTION(int) : function_base(), invoker(0) {} +#endif BOOST_FUNCTION_FUNCTION(const BOOST_FUNCTION_FUNCTION& f) : function_base(), @@ -348,7 +350,13 @@ namespace boost { this->clear(); return *this; } -#endif // BOOST_FUNCTION_NO_ENABLE_IF +#else + BOOST_FUNCTION_FUNCTION& operator=(int) + { + this->clear(); + return *this; + } +#endif // Assignment from another BOOST_FUNCTION_FUNCTION BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f)