mirror of
https://github.com/boostorg/function.git
synced 2025-07-29 12:27:15 +02:00
function_base.hpp:
- Add trivial_manager that does nothing but copy object pointers - Add is_ref to determine if a type is a reference_wrapper - Add function_obj_ref_tag for reference_wrappers - Teach get_function_tag about reference_wrappers function_template.hpp: - Add assign_to overload for reference_wrappers (these don't throw) [SVN r11875]
This commit is contained in:
@ -391,6 +391,28 @@ namespace boost {
|
||||
}
|
||||
}
|
||||
|
||||
template<typename FunctionObj>
|
||||
void assign_to(const reference_wrapper<FunctionObj>& f,
|
||||
detail::function::function_obj_ref_tag)
|
||||
{
|
||||
if (!detail::function::has_empty_target(&f.get())) {
|
||||
typedef
|
||||
typename detail::function::BOOST_FUNCTION_GET_FUNCTION_OBJ_INVOKER<
|
||||
FunctionObj,
|
||||
R BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS
|
||||
>::type
|
||||
invoker_type;
|
||||
|
||||
invoker = &invoker_type::invoke;
|
||||
manager = &detail::function::trivial_manager;
|
||||
functor =
|
||||
manager(detail::function::any_pointer(
|
||||
const_cast<FunctionObj*>(&f.get())),
|
||||
detail::function::clone_functor_tag);
|
||||
}
|
||||
}
|
||||
|
||||
typedef result_type (*invoker_type)(detail::function::any_pointer
|
||||
BOOST_FUNCTION_COMMA
|
||||
BOOST_FUNCTION_TEMPLATE_ARGS);
|
||||
|
Reference in New Issue
Block a user