forked from boostorg/function
function_base.hpp:
function_template.hpp: - Revert to older implementation of has_empty_function (Metrowerks doesn't handle is_base_and_derived correctly) [SVN r13854]
This commit is contained in:
@ -341,20 +341,14 @@ namespace boost {
|
|||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
namespace function {
|
namespace function {
|
||||||
// The result is not a Boost.Function object, so we assume that this
|
inline bool has_empty_target(const function_base* f)
|
||||||
// target is not empty
|
|
||||||
template<typename FunctionObj>
|
|
||||||
inline bool has_empty_target(const FunctionObj&, truth<false>)
|
|
||||||
{
|
{
|
||||||
return false;
|
return f->empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
// The result is a Boost.Function object, so query whether it is empty
|
inline bool has_empty_target(...)
|
||||||
// or not
|
{
|
||||||
template<typename FunctionObj>
|
return false;
|
||||||
inline bool has_empty_target(const FunctionObj& f, truth<true>)
|
|
||||||
{
|
|
||||||
return f.empty();
|
|
||||||
}
|
}
|
||||||
} // end namespace function
|
} // end namespace function
|
||||||
} // end namespace detail
|
} // end namespace detail
|
||||||
|
@ -425,11 +425,7 @@ namespace boost {
|
|||||||
template<typename FunctionObj>
|
template<typename FunctionObj>
|
||||||
void assign_to(FunctionObj f, detail::function::function_obj_tag)
|
void assign_to(FunctionObj f, detail::function::function_obj_tag)
|
||||||
{
|
{
|
||||||
typedef detail::function::truth<
|
if (!detail::function::has_empty_target(addressof(f))) {
|
||||||
boost::is_base_and_derived<function_base, FunctionObj>::value>
|
|
||||||
is_boost_function;
|
|
||||||
|
|
||||||
if (!detail::function::has_empty_target(f, is_boost_function())) {
|
|
||||||
typedef
|
typedef
|
||||||
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
||||||
FunctionObj,
|
FunctionObj,
|
||||||
@ -463,11 +459,7 @@ namespace boost {
|
|||||||
void assign_to(const reference_wrapper<FunctionObj>& f,
|
void assign_to(const reference_wrapper<FunctionObj>& f,
|
||||||
detail::function::function_obj_ref_tag)
|
detail::function::function_obj_ref_tag)
|
||||||
{
|
{
|
||||||
typedef detail::function::truth<
|
if (!detail::function::has_empty_target(f.get_pointer())) {
|
||||||
boost::is_base_and_derived<function_base, FunctionObj>::value>
|
|
||||||
is_boost_function;
|
|
||||||
|
|
||||||
if (!detail::function::has_empty_target(f.get(), is_boost_function())) {
|
|
||||||
typedef
|
typedef
|
||||||
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
||||||
FunctionObj,
|
FunctionObj,
|
||||||
|
Reference in New Issue
Block a user