function_template.cpp:

- Correctly copy mixin when assigning from any function/function object


[SVN r10617]
This commit is contained in:
Douglas Gregor
2001-07-14 18:51:00 +00:00
parent 40b70509cc
commit aad9b5f5e0

View File

@ -559,7 +559,7 @@ namespace boost {
template<typename Functor>
BOOST_FUNCTION_FUNCTION& operator=(const Functor& f)
{
BOOST_FUNCTION_FUNCTION(f).swap(*this);
BOOST_FUNCTION_FUNCTION(f, static_cast<const Mixin&>(*this)).swap(*this);
return *this;
}
@ -567,7 +567,7 @@ namespace boost {
template<typename Functor>
BOOST_FUNCTION_FUNCTION& operator=(Functor* f)
{
BOOST_FUNCTION_FUNCTION(f).swap(*this);
BOOST_FUNCTION_FUNCTION(f, static_cast<const Mixin&>(*this)).swap(*this);
return *this;
}
#endif // __BORLANDC__
@ -575,14 +575,14 @@ namespace boost {
template<typename Functor>
void set(const Functor& f)
{
BOOST_FUNCTION_FUNCTION(f).swap(*this);
BOOST_FUNCTION_FUNCTION(f, static_cast<const Mixin&>(*this)).swap(*this);
}
#ifdef __BORLANDC__
template<typename Functor>
void set(Functor* f)
{
BOOST_FUNCTION_FUNCTION(f).swap(*this);
BOOST_FUNCTION_FUNCTION(f, static_cast<const Mixin&>(*this)).swap(*this);
}
#endif // __BORLANDC__