mirror of
https://github.com/boostorg/function.git
synced 2025-07-25 02:17:14 +02:00
Use boost/assert.hpp to check (at runtime) if the int passed to Boost.Function's
clearing constructor is zero [SVN r16614]
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include <memory>
|
||||
#include <new>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/type_traits/arithmetic_traits.hpp>
|
||||
#include <boost/type_traits/composite_traits.hpp>
|
||||
#include <boost/type_traits/is_stateless.hpp>
|
||||
|
@ -296,7 +296,10 @@ namespace boost {
|
||||
#ifndef BOOST_FUNCTION_NO_ENABLE_IF
|
||||
BOOST_FUNCTION_FUNCTION(clear_type*) : function_base(), invoker(0) {}
|
||||
#else
|
||||
BOOST_FUNCTION_FUNCTION(int) : function_base(), invoker(0) {}
|
||||
BOOST_FUNCTION_FUNCTION(int zero) : function_base(), invoker(0)
|
||||
{
|
||||
BOOST_ASSERT(zero == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_FUNCTION_FUNCTION(const BOOST_FUNCTION_FUNCTION& f) :
|
||||
@ -351,8 +354,9 @@ namespace boost {
|
||||
return *this;
|
||||
}
|
||||
#else
|
||||
BOOST_FUNCTION_FUNCTION& operator=(int)
|
||||
BOOST_FUNCTION_FUNCTION& operator=(int zero)
|
||||
{
|
||||
BOOST_ASSERT(zero == 0);
|
||||
this->clear();
|
||||
return *this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user