mirror of
https://github.com/boostorg/function.git
synced 2025-07-24 01:47:15 +02:00
Untabified
[SVN r12335]
This commit is contained in:
@ -82,13 +82,13 @@ namespace boost {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
struct is_ref
|
struct is_ref
|
||||||
{
|
{
|
||||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct is_ref<reference_wrapper<T> >
|
struct is_ref<reference_wrapper<T> >
|
||||||
{
|
{
|
||||||
BOOST_STATIC_CONSTANT(bool, value = true);
|
BOOST_STATIC_CONSTANT(bool, value = true);
|
||||||
};
|
};
|
||||||
#else // no partial specialization
|
#else // no partial specialization
|
||||||
typedef char yes_type;
|
typedef char yes_type;
|
||||||
@ -102,9 +102,9 @@ namespace boost {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
struct is_ref
|
struct is_ref
|
||||||
{
|
{
|
||||||
static T* t;
|
static T* t;
|
||||||
BOOST_STATIC_CONSTANT(bool,
|
BOOST_STATIC_CONSTANT(bool,
|
||||||
value = (sizeof(is_ref_tester(t)) == sizeof(yes_type)));
|
value = (sizeof(is_ref_tester(t)) == sizeof(yes_type)));
|
||||||
};
|
};
|
||||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||||
|
|
||||||
@ -165,28 +165,28 @@ namespace boost {
|
|||||||
template<typename F>
|
template<typename F>
|
||||||
class get_function_tag
|
class get_function_tag
|
||||||
{
|
{
|
||||||
typedef typename IF<(is_pointer<F>::value),
|
typedef typename IF<(is_pointer<F>::value),
|
||||||
function_ptr_tag,
|
function_ptr_tag,
|
||||||
function_obj_tag>::type ptr_or_obj_tag;
|
function_obj_tag>::type ptr_or_obj_tag;
|
||||||
|
|
||||||
typedef typename IF<(is_member_pointer<F>::value),
|
typedef typename IF<(is_member_pointer<F>::value),
|
||||||
member_ptr_tag,
|
member_ptr_tag,
|
||||||
ptr_or_obj_tag>::type ptr_or_obj_or_mem_tag;
|
ptr_or_obj_tag>::type ptr_or_obj_or_mem_tag;
|
||||||
public:
|
public:
|
||||||
typedef typename IF<(is_ref<F>::value),
|
typedef typename IF<(is_ref<F>::value),
|
||||||
function_obj_ref_tag,
|
function_obj_ref_tag,
|
||||||
ptr_or_obj_or_mem_tag>::type type;
|
ptr_or_obj_or_mem_tag>::type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
// The trivial manager does nothing but return the same pointer (if we
|
// The trivial manager does nothing but return the same pointer (if we
|
||||||
// are cloning) or return the null pointer (if we are deleting).
|
// are cloning) or return the null pointer (if we are deleting).
|
||||||
inline any_pointer trivial_manager(any_pointer f,
|
inline any_pointer trivial_manager(any_pointer f,
|
||||||
functor_manager_operation_type op)
|
functor_manager_operation_type op)
|
||||||
{
|
{
|
||||||
if (op == clone_functor_tag)
|
if (op == clone_functor_tag)
|
||||||
return f;
|
return f;
|
||||||
else
|
else
|
||||||
return any_pointer(reinterpret_cast<void*>(0));
|
return any_pointer(reinterpret_cast<void*>(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -331,8 +331,8 @@ namespace boost {
|
|||||||
function_base::manager = &detail::function::functor_manager<FunctionPtr,
|
function_base::manager = &detail::function::functor_manager<FunctionPtr,
|
||||||
Allocator>::manage;
|
Allocator>::manage;
|
||||||
function_base::functor = function_base::manager(detail::function::any_pointer(
|
function_base::functor = function_base::manager(detail::function::any_pointer(
|
||||||
// should be a reinterpret cast, but some compilers
|
// should be a reinterpret cast, but some compilers
|
||||||
// insist on giving cv-qualifiers to free functions
|
// insist on giving cv-qualifiers to free functions
|
||||||
(void (*)())(f)
|
(void (*)())(f)
|
||||||
),
|
),
|
||||||
detail::function::clone_functor_tag);
|
detail::function::clone_functor_tag);
|
||||||
@ -370,7 +370,7 @@ namespace boost {
|
|||||||
|
|
||||||
template<typename FunctionObj>
|
template<typename FunctionObj>
|
||||||
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)
|
||||||
{
|
{
|
||||||
if (!detail::function::has_empty_target(&f.get())) {
|
if (!detail::function::has_empty_target(&f.get())) {
|
||||||
typedef
|
typedef
|
||||||
@ -385,7 +385,7 @@ namespace boost {
|
|||||||
function_base::manager = &detail::function::trivial_manager;
|
function_base::manager = &detail::function::trivial_manager;
|
||||||
function_base::functor =
|
function_base::functor =
|
||||||
function_base::manager(detail::function::any_pointer(
|
function_base::manager(detail::function::any_pointer(
|
||||||
const_cast<FunctionObj*>(&f.get())),
|
const_cast<FunctionObj*>(&f.get())),
|
||||||
detail::function::clone_functor_tag);
|
detail::function::clone_functor_tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user