Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions include/boost/callable_traits/detail/default_callable_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct default_callable_traits {
using type = error_t;

// std::true_type for callables with C-style variadics
using has_varargs = std::false_type;
static constexpr bool has_varargs = false;

using return_type = error_t;

Expand Down Expand Up @@ -67,7 +67,7 @@ struct default_callable_traits {

// std::true_type when the signature includes noexcept, when
// the feature is available
using is_noexcept = std::false_type;
static constexpr bool is_noexcept = false;

// adds noexcept to a signature if the feature is available
using add_noexcept = error_t;
Expand All @@ -77,7 +77,7 @@ struct default_callable_traits {

// std::true_type when the signature includes transaction_safe, when
// the feature is available
using is_transaction_safe = std::false_type;
static constexpr bool is_transaction_safe = false;

// adds transaction_safe to a signature if the feature is available
using add_transaction_safe = error_t;
Expand Down Expand Up @@ -184,19 +184,19 @@ struct default_callable_traits {
static constexpr qualifier_flags ref_flags = ref_of<T>::value;
static constexpr qualifier_flags q_flags = cv_flags | ref_flags;

using has_member_qualifiers = std::integral_constant<bool, q_flags != default_>;
using is_const_member = std::integral_constant<bool, 0 < (cv_flags & const_)>;
using is_volatile_member = std::integral_constant<bool, 0 < (cv_flags & volatile_)>;
using is_cv_member = std::integral_constant<bool, cv_flags == (const_ | volatile_)>;
static constexpr bool has_member_qualifiers = q_flags != default_;
static constexpr bool is_const_member = 0 < (cv_flags & const_);
static constexpr bool is_volatile_member = 0 < (cv_flags & volatile_);
static constexpr bool is_cv_member = cv_flags == (const_ | volatile_);

#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
using is_reference_member = std::false_type;
using is_lvalue_reference_member = std::false_type;
using is_rvalue_reference_member = std::false_type;
static constexpr bool is_reference_member = false;
static constexpr bool is_lvalue_reference_member = false;
static constexpr bool is_rvalue_reference_member = false;
#else
using is_reference_member = std::integral_constant<bool, 0 < ref_flags>;
using is_lvalue_reference_member = std::integral_constant<bool, ref_flags == lref_>;
using is_rvalue_reference_member = std::integral_constant<bool, ref_flags == rref_>;
static constexpr bool is_reference_member = 0 < ref_flags;
static constexpr bool is_lvalue_reference_member = ref_flags == lref_;
static constexpr bool is_rvalue_reference_member = ref_flags == rref_;
#endif //#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS

};
Expand Down
4 changes: 2 additions & 2 deletions include/boost/callable_traits/detail/function_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ struct function_object : Base {
using invoke_type = error_t;
using remove_varargs = error_t;
using add_varargs = error_t;
using is_noexcept = typename Base::is_noexcept;
static constexpr bool is_noexcept = Base::is_noexcept;
using add_noexcept = error_t;
using remove_noexcept = error_t;
using is_transaction_safe = typename Base::is_transaction_safe;
static constexpr bool is_transaction_safe = Base::is_transaction_safe;
using add_transaction_safe = error_t;
using remove_transaction_safe = error_t;
using clear_args = error_t;
Expand Down
8 changes: 4 additions & 4 deletions include/boost/callable_traits/detail/is_invocable_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ namespace boost { namespace callable_traits { namespace detail {
using generalize_if_dissimilar = typename std::conditional<
IsBaseOf::value || IsSame::value, T, generalize<T>>::type;

template<typename Traits, bool = Traits::is_const_member::value
|| Traits::is_volatile_member::value
|| Traits::is_lvalue_reference_member::value
|| Traits::is_rvalue_reference_member::value>
template<typename Traits, bool = Traits::is_const_member
|| Traits::is_volatile_member
|| Traits::is_lvalue_reference_member
|| Traits::is_rvalue_reference_member>
struct test_invoke {

template<typename... Rgs,
Expand Down
2 changes: 0 additions & 2 deletions include/boost/callable_traits/detail/pmd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ struct pmd<D T::*> : default_callable_traits<> {

template<template<class...> class Container>
using expand_args = Container<invoke_type>;

using is_member_pointer = std::true_type;
};

}}} // namespace boost::callable_traits::detail
Expand Down
6 changes: 3 additions & 3 deletions include/boost/callable_traits/detail/unguarded/function.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ DO NOT INCLUDE THIS HEADER DIRECTLY
*/

#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::false_type
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE false
#include <boost/callable_traits/detail/unguarded/function_2.hpp>
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE

#ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::true_type
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE true
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE transaction_safe
#include <boost/callable_traits/detail/unguarded/function_2.hpp>
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
6 changes: 3 additions & 3 deletions include/boost/callable_traits/detail/unguarded/function_2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ DO NOT INCLUDE THIS HEADER DIRECTLY
*/

#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::false_type
#define BOOST_CLBL_TRTS_IS_NOEXCEPT false
#include <boost/callable_traits/detail/unguarded/function_3.hpp>
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT

#ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC noexcept
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::true_type
#define BOOST_CLBL_TRTS_IS_NOEXCEPT true
#include <boost/callable_traits/detail/unguarded/function_3.hpp>
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
26 changes: 11 additions & 15 deletions include/boost/callable_traits/detail/unguarded/function_3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS - the function-level qualifiers for the
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
the current include (`transaction_safe` or nothing)

BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `true` or `false`,
tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`

BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
Expand All @@ -24,7 +24,7 @@ BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
the current include (`noexcept` or nothing)

BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
BOOST_CLBL_TRTS_IS_NOEXCEPT - `true` or `false`,
tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`

BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
Expand Down Expand Up @@ -67,7 +67,7 @@ struct function<Return(Args...)
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;

using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
static constexpr bool is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;

using remove_noexcept = Return(Args...)
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
Expand All @@ -78,7 +78,7 @@ struct function<Return(Args...)
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;

using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
static constexpr bool is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;

using remove_transaction_safe = Return(Args...)
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
Expand All @@ -92,8 +92,8 @@ struct function<Return(Args...)
using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;

template<qualifier_flags Flags>
using set_qualifiers = set_function_qualifiers<Flags, is_transaction_safe::value,
is_noexcept::value, Return, Args...>;
using set_qualifiers = set_function_qualifiers<Flags, is_transaction_safe,
is_noexcept, Return, Args...>;

#ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS

Expand Down Expand Up @@ -140,8 +140,6 @@ struct function<Return(Args...)

template<template<class...> class Container>
using expand_args = Container<Args...>;

using is_member_pointer = std::false_type;
};


Expand All @@ -154,7 +152,7 @@ struct function<Return (Args..., ...)

static constexpr bool value = true;

using has_varargs = std::true_type;
static constexpr bool has_varargs = true;
using traits = function;
using return_type = Return;
using arg_types = std::tuple<Args...>;
Expand All @@ -178,7 +176,7 @@ struct function<Return (Args..., ...)

using add_varargs = type;

using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
static constexpr bool is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;

using remove_noexcept = Return(Args..., ...)
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
Expand All @@ -189,7 +187,7 @@ struct function<Return (Args..., ...)
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;

using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
static constexpr bool is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;

using remove_transaction_safe = Return(Args..., ...)
BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
Expand All @@ -203,8 +201,8 @@ struct function<Return (Args..., ...)
using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;

template<qualifier_flags Flags>
using set_qualifiers = set_varargs_function_qualifiers<Flags, is_transaction_safe::value,
is_noexcept::value, Return, Args...>;
using set_qualifiers = set_varargs_function_qualifiers<Flags, is_transaction_safe,
is_noexcept, Return, Args...>;

#ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS

Expand Down Expand Up @@ -255,6 +253,4 @@ struct function<Return (Args..., ...)

template<template<class...> class Container>
using expand_args = Container<Args...>;

using is_member_pointer = std::false_type;
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ DO NOT INCLUDE THIS HEADER DIRECTLY
*/

#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::false_type
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE false
#include <boost/callable_traits/detail/unguarded/function_ptr_2.hpp>

#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE

#ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::true_type
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE true
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE transaction_safe
#include <boost/callable_traits/detail/unguarded/function_ptr_2.hpp>
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ DO NOT INCLUDE THIS HEADER DIRECTLY
*/

#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::false_type
#define BOOST_CLBL_TRTS_IS_NOEXCEPT false
#include <boost/callable_traits/detail/unguarded/function_ptr_3.hpp>
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT

#ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC noexcept
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::true_type
#define BOOST_CLBL_TRTS_IS_NOEXCEPT true
#include <boost/callable_traits/detail/unguarded/function_ptr_3.hpp>
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ macros used:
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
the current include (`transaction_safe` or nothing)

BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `true` or `false`,
tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`

BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
Expand All @@ -21,7 +21,7 @@ BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
the current include (`noexcept` or nothing)

BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
BOOST_CLBL_TRTS_IS_NOEXCEPT - `true` or `false`,
tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`

BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
Expand Down Expand Up @@ -56,7 +56,7 @@ struct function<
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;

using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
static constexpr bool is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;

using remove_noexcept = Return(BOOST_CLBL_TRTS_CC *)(Args...)
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
Expand All @@ -65,7 +65,7 @@ struct function<
BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;

using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
static constexpr bool is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;

using remove_transaction_safe = Return(BOOST_CLBL_TRTS_CC *)(Args...)
BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
Expand All @@ -88,7 +88,5 @@ struct function<

template<template<class...> class Container>
using expand_args = Container<Args...>;

using is_member_pointer = std::false_type;
};

Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ DO NOT INCLUDE THIS HEADER DIRECTLY
*/

#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::false_type
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE false
#include <boost/callable_traits/detail/unguarded/function_ptr_varargs_2.hpp>
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE

#ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE std::true_type
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE true
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE transaction_safe
#include <boost/callable_traits/detail/unguarded/function_ptr_varargs_2.hpp>
#undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
#undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ DO NOT INCLUDE THIS HEADER DIRECTLY
*/

#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::false_type
#define BOOST_CLBL_TRTS_IS_NOEXCEPT false
#include <boost/callable_traits/detail/unguarded/function_ptr_varargs_3.hpp>
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT

#ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC noexcept
#define BOOST_CLBL_TRTS_IS_NOEXCEPT std::true_type
#define BOOST_CLBL_TRTS_IS_NOEXCEPT true
#include <boost/callable_traits/detail/unguarded/function_ptr_varargs_3.hpp>
#undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC
#undef BOOST_CLBL_TRTS_IS_NOEXCEPT
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES
Loading