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]
This commit is contained in:
Douglas Gregor
2002-12-15 14:51:16 +00:00
parent 4466a7c9c0
commit da9d12d1b9

View File

@ -295,7 +295,9 @@ namespace boost {
#ifndef BOOST_FUNCTION_NO_ENABLE_IF #ifndef BOOST_FUNCTION_NO_ENABLE_IF
BOOST_FUNCTION_FUNCTION(clear_type*) : function_base(), invoker(0) {} 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) : BOOST_FUNCTION_FUNCTION(const BOOST_FUNCTION_FUNCTION& f) :
function_base(), function_base(),
@ -348,7 +350,13 @@ namespace boost {
this->clear(); this->clear();
return *this; 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 // Assignment from another BOOST_FUNCTION_FUNCTION
BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f) BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f)