mirror of
https://github.com/boostorg/function.git
synced 2025-07-25 10:27:14 +02:00
function_template.cpp:
- Correctly copy mixin when assigning from any function/function object [SVN r10617]
This commit is contained in:
@ -559,7 +559,7 @@ namespace boost {
|
|||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
BOOST_FUNCTION_FUNCTION& operator=(const Functor& f)
|
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;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -567,7 +567,7 @@ namespace boost {
|
|||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
BOOST_FUNCTION_FUNCTION& operator=(Functor* f)
|
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;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif // __BORLANDC__
|
#endif // __BORLANDC__
|
||||||
@ -575,14 +575,14 @@ namespace boost {
|
|||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
void set(const Functor& f)
|
void set(const Functor& f)
|
||||||
{
|
{
|
||||||
BOOST_FUNCTION_FUNCTION(f).swap(*this);
|
BOOST_FUNCTION_FUNCTION(f, static_cast<const Mixin&>(*this)).swap(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
void set(Functor* f)
|
void set(Functor* f)
|
||||||
{
|
{
|
||||||
BOOST_FUNCTION_FUNCTION(f).swap(*this);
|
BOOST_FUNCTION_FUNCTION(f, static_cast<const Mixin&>(*this)).swap(*this);
|
||||||
}
|
}
|
||||||
#endif // __BORLANDC__
|
#endif // __BORLANDC__
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user