mirror of
https://github.com/boostorg/function.git
synced 2025-07-23 17:37:14 +02:00
Renamed BOOST_MSVC_ONLY to BOOST_FUNCTION_TARGET_FIX
Metrowerks needs the BOOST_FUNCTION_TARGET_FIX workaround [SVN r12144]
This commit is contained in:
@ -456,12 +456,12 @@ namespace boost {
|
|||||||
function() : base_type() {}
|
function() : base_type() {}
|
||||||
|
|
||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
function(Functor BOOST_MSVC_ONLY(const &) f) : base_type(f) {}
|
function(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) : base_type(f) {}
|
||||||
|
|
||||||
function(const self_type& f) : base_type(static_cast<const base_type&>(f)){}
|
function(const self_type& f) : base_type(static_cast<const base_type&>(f)){}
|
||||||
|
|
||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
self_type& operator=(Functor BOOST_MSVC_ONLY(const &) f)
|
self_type& operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
|
||||||
{
|
{
|
||||||
self_type(f).swap(*this);
|
self_type(f).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -480,7 +480,7 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
void set(Functor BOOST_MSVC_ONLY(const &) f)
|
void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
|
||||||
{
|
{
|
||||||
self_type(f).swap(*this);
|
self_type(f).swap(*this);
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
#include <boost/type_traits.hpp>
|
#include <boost/type_traits.hpp>
|
||||||
#include <boost/ref.hpp>
|
#include <boost/ref.hpp>
|
||||||
|
|
||||||
#ifdef BOOST_MSVC
|
#if defined(BOOST_MSVC) || defined(__MWERKS__)
|
||||||
# define BOOST_MSVC_ONLY(x) x
|
# define BOOST_FUNCTION_TARGET_FIX(x) x
|
||||||
#else
|
#else
|
||||||
# define BOOST_MSVC_ONLY(x)
|
# define BOOST_FUNCTION_TARGET_FIX(x)
|
||||||
#endif // not MSVC
|
#endif // not MSVC
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
|
@ -203,7 +203,7 @@ namespace boost {
|
|||||||
// MSVC chokes if the following two constructors are collapsed into
|
// MSVC chokes if the following two constructors are collapsed into
|
||||||
// one with a default parameter.
|
// one with a default parameter.
|
||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
BOOST_FUNCTION_FUNCTION(Functor BOOST_MSVC_ONLY(const &) f) :
|
BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f) :
|
||||||
function_base(), Mixin(), invoker(0)
|
function_base(), Mixin(), invoker(0)
|
||||||
{
|
{
|
||||||
this->assign_to(f);
|
this->assign_to(f);
|
||||||
@ -244,14 +244,15 @@ namespace boost {
|
|||||||
// handle BOOST_FUNCTION_FUNCTION as the type of the temporary to
|
// handle BOOST_FUNCTION_FUNCTION as the type of the temporary to
|
||||||
// construct.
|
// construct.
|
||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
BOOST_FUNCTION_FUNCTION& operator=(Functor f)
|
BOOST_FUNCTION_FUNCTION&
|
||||||
|
operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
|
||||||
{
|
{
|
||||||
self_type(f, static_cast<const Mixin&>(*this)).swap(*this);
|
self_type(f, static_cast<const Mixin&>(*this)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
void set(Functor f)
|
void set(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
|
||||||
{
|
{
|
||||||
self_type(f, static_cast<const Mixin&>(*this)).swap(*this);
|
self_type(f, static_cast<const Mixin&>(*this)).swap(*this);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user