From 2f2809620bf61634a145a3ce4d3cde79d3706d9b Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Thu, 25 Sep 2025 16:21:16 -0500 Subject: [PATCH] Prefer static constexpr bool over std::true_type or std::false_type --- .../detail/default_callable_traits.hpp | 26 +++++++++---------- .../detail/function_object.hpp | 4 +-- .../detail/is_invocable_impl.hpp | 8 +++--- include/boost/callable_traits/detail/pmd.hpp | 2 -- .../detail/unguarded/function.hpp | 6 ++--- .../detail/unguarded/function_2.hpp | 6 ++--- .../detail/unguarded/function_3.hpp | 26 ++++++++----------- .../detail/unguarded/function_ptr.hpp | 4 +-- .../detail/unguarded/function_ptr_2.hpp | 6 ++--- .../detail/unguarded/function_ptr_3.hpp | 10 +++---- .../detail/unguarded/function_ptr_varargs.hpp | 6 ++--- .../unguarded/function_ptr_varargs_2.hpp | 6 ++--- .../unguarded/function_ptr_varargs_3.hpp | 12 ++++----- .../detail/unguarded/pmf_2.hpp | 4 +-- .../detail/unguarded/pmf_3.hpp | 6 ++--- .../detail/unguarded/pmf_4.hpp | 12 ++++----- .../detail/unguarded/pmf_varargs_2.hpp | 4 +-- .../detail/unguarded/pmf_varargs_3.hpp | 6 ++--- .../detail/unguarded/pmf_varargs_4.hpp | 14 +++++----- .../callable_traits/has_member_qualifiers.hpp | 11 +++----- include/boost/callable_traits/has_varargs.hpp | 11 +++----- .../boost/callable_traits/is_const_member.hpp | 10 +++---- .../boost/callable_traits/is_cv_member.hpp | 10 +++---- .../is_lvalue_reference_member.hpp | 10 +++---- include/boost/callable_traits/is_noexcept.hpp | 9 +++---- .../callable_traits/is_reference_member.hpp | 11 +++----- .../is_rvalue_reference_member.hpp | 11 +++----- .../callable_traits/is_transaction_safe.hpp | 11 +++----- .../callable_traits/is_volatile_member.hpp | 11 +++----- 29 files changed, 117 insertions(+), 156 deletions(-) diff --git a/include/boost/callable_traits/detail/default_callable_traits.hpp b/include/boost/callable_traits/detail/default_callable_traits.hpp index 8497078..91a6fc5 100644 --- a/include/boost/callable_traits/detail/default_callable_traits.hpp +++ b/include/boost/callable_traits/detail/default_callable_traits.hpp @@ -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; @@ -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; @@ -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; @@ -184,19 +184,19 @@ struct default_callable_traits { static constexpr qualifier_flags ref_flags = ref_of::value; static constexpr qualifier_flags q_flags = cv_flags | ref_flags; - using has_member_qualifiers = std::integral_constant; - using is_const_member = std::integral_constant; - using is_volatile_member = std::integral_constant; - using is_cv_member = std::integral_constant; + 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; - using is_lvalue_reference_member = std::integral_constant; - using is_rvalue_reference_member = std::integral_constant; + 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 }; diff --git a/include/boost/callable_traits/detail/function_object.hpp b/include/boost/callable_traits/detail/function_object.hpp index d12fc00..98c2726 100644 --- a/include/boost/callable_traits/detail/function_object.hpp +++ b/include/boost/callable_traits/detail/function_object.hpp @@ -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; diff --git a/include/boost/callable_traits/detail/is_invocable_impl.hpp b/include/boost/callable_traits/detail/is_invocable_impl.hpp index 69da497..d0a1f25 100644 --- a/include/boost/callable_traits/detail/is_invocable_impl.hpp +++ b/include/boost/callable_traits/detail/is_invocable_impl.hpp @@ -72,10 +72,10 @@ namespace boost { namespace callable_traits { namespace detail { using generalize_if_dissimilar = typename std::conditional< IsBaseOf::value || IsSame::value, T, generalize>::type; - template + template struct test_invoke { template : default_callable_traits<> { template class Container> using expand_args = Container; - - using is_member_pointer = std::true_type; }; }}} // namespace boost::callable_traits::detail diff --git a/include/boost/callable_traits/detail/unguarded/function.hpp b/include/boost/callable_traits/detail/unguarded/function.hpp index a1d32e9..7ef448b 100644 --- a/include/boost/callable_traits/detail/unguarded/function.hpp +++ b/include/boost/callable_traits/detail/unguarded/function.hpp @@ -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 #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 #undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE #undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE -#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE \ No newline at end of file +#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE diff --git a/include/boost/callable_traits/detail/unguarded/function_2.hpp b/include/boost/callable_traits/detail/unguarded/function_2.hpp index 562b4e9..4cdb4ff 100644 --- a/include/boost/callable_traits/detail/unguarded/function_2.hpp +++ b/include/boost/callable_traits/detail/unguarded/function_2.hpp @@ -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 #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 #undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC #undef BOOST_CLBL_TRTS_IS_NOEXCEPT -#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES \ No newline at end of file +#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES diff --git a/include/boost/callable_traits/detail/unguarded/function_3.hpp b/include/boost/callable_traits/detail/unguarded/function_3.hpp index 2c329c4..0dfe0ef 100644 --- a/include/boost/callable_traits/detail/unguarded/function_3.hpp +++ b/include/boost/callable_traits/detail/unguarded/function_3.hpp @@ -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 @@ -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 @@ -67,7 +67,7 @@ struct function; template - using set_qualifiers = set_function_qualifiers; + using set_qualifiers = set_function_qualifiers; #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS @@ -140,8 +140,6 @@ struct function class Container> using expand_args = Container; - - using is_member_pointer = std::false_type; }; @@ -154,7 +152,7 @@ struct function; @@ -178,7 +176,7 @@ struct function; template - using set_qualifiers = set_varargs_function_qualifiers; + using set_qualifiers = set_varargs_function_qualifiers; #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS @@ -255,6 +253,4 @@ struct function class Container> using expand_args = Container; - - using is_member_pointer = std::false_type; }; diff --git a/include/boost/callable_traits/detail/unguarded/function_ptr.hpp b/include/boost/callable_traits/detail/unguarded/function_ptr.hpp index 4aa8ad5..66c3e12 100644 --- a/include/boost/callable_traits/detail/unguarded/function_ptr.hpp +++ b/include/boost/callable_traits/detail/unguarded/function_ptr.hpp @@ -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 #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 #endif diff --git a/include/boost/callable_traits/detail/unguarded/function_ptr_2.hpp b/include/boost/callable_traits/detail/unguarded/function_ptr_2.hpp index b54f2ed..ca13afe 100644 --- a/include/boost/callable_traits/detail/unguarded/function_ptr_2.hpp +++ b/include/boost/callable_traits/detail/unguarded/function_ptr_2.hpp @@ -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 #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 #undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC #undef BOOST_CLBL_TRTS_IS_NOEXCEPT -#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES \ No newline at end of file +#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES diff --git a/include/boost/callable_traits/detail/unguarded/function_ptr_3.hpp b/include/boost/callable_traits/detail/unguarded/function_ptr_3.hpp index e657b57..660e5fc 100644 --- a/include/boost/callable_traits/detail/unguarded/function_ptr_3.hpp +++ b/include/boost/callable_traits/detail/unguarded/function_ptr_3.hpp @@ -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 @@ -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 @@ -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; @@ -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; @@ -88,7 +88,5 @@ struct function< template class Container> using expand_args = Container; - - using is_member_pointer = std::false_type; }; diff --git a/include/boost/callable_traits/detail/unguarded/function_ptr_varargs.hpp b/include/boost/callable_traits/detail/unguarded/function_ptr_varargs.hpp index 625f0d6..9f635ee 100644 --- a/include/boost/callable_traits/detail/unguarded/function_ptr_varargs.hpp +++ b/include/boost/callable_traits/detail/unguarded/function_ptr_varargs.hpp @@ -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 #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 #undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE #undef BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE -#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE \ No newline at end of file +#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE diff --git a/include/boost/callable_traits/detail/unguarded/function_ptr_varargs_2.hpp b/include/boost/callable_traits/detail/unguarded/function_ptr_varargs_2.hpp index 9ed68fc..a1442c4 100644 --- a/include/boost/callable_traits/detail/unguarded/function_ptr_varargs_2.hpp +++ b/include/boost/callable_traits/detail/unguarded/function_ptr_varargs_2.hpp @@ -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 #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 #undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC #undef BOOST_CLBL_TRTS_IS_NOEXCEPT -#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES \ No newline at end of file +#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES diff --git a/include/boost/callable_traits/detail/unguarded/function_ptr_varargs_3.hpp b/include/boost/callable_traits/detail/unguarded/function_ptr_varargs_3.hpp index 42e2293..a0aef47 100644 --- a/include/boost/callable_traits/detail/unguarded/function_ptr_varargs_3.hpp +++ b/include/boost/callable_traits/detail/unguarded/function_ptr_varargs_3.hpp @@ -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 @@ -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 @@ -36,7 +36,7 @@ struct function class Container> using expand_args = Container; - - using is_member_pointer = std::false_type; }; diff --git a/include/boost/callable_traits/detail/unguarded/pmf_2.hpp b/include/boost/callable_traits/detail/unguarded/pmf_2.hpp index e3568fb..c177c6b 100644 --- a/include/boost/callable_traits/detail/unguarded/pmf_2.hpp +++ b/include/boost/callable_traits/detail/unguarded/pmf_2.hpp @@ -58,14 +58,14 @@ struct set_member_function_qualifiers_t< }; #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 #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 #undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE diff --git a/include/boost/callable_traits/detail/unguarded/pmf_3.hpp b/include/boost/callable_traits/detail/unguarded/pmf_3.hpp index 62b34f2..f9af934 100644 --- a/include/boost/callable_traits/detail/unguarded/pmf_3.hpp +++ b/include/boost/callable_traits/detail/unguarded/pmf_3.hpp @@ -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 #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 #undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC #undef BOOST_CLBL_TRTS_IS_NOEXCEPT -#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES \ No newline at end of file +#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES diff --git a/include/boost/callable_traits/detail/unguarded/pmf_4.hpp b/include/boost/callable_traits/detail/unguarded/pmf_4.hpp index 5a1f48c..908bf8d 100644 --- a/include/boost/callable_traits/detail/unguarded/pmf_4.hpp +++ b/include/boost/callable_traits/detail/unguarded/pmf_4.hpp @@ -13,7 +13,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 @@ -22,7 +22,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 @@ -73,7 +73,7 @@ struct pmf using set_qualifiers = set_member_function_qualifiers< - Flags, is_transaction_safe::value, is_noexcept::value, + Flags, is_transaction_safe, is_noexcept, BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...>; using remove_member_reference = set_qualifiers; @@ -142,6 +142,4 @@ struct pmf class Container> using expand_args = Container; - - using is_member_pointer = std::true_type; }; diff --git a/include/boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp b/include/boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp index 5de0668..272ca19 100644 --- a/include/boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp +++ b/include/boost/callable_traits/detail/unguarded/pmf_varargs_2.hpp @@ -61,7 +61,7 @@ struct set_varargs_member_function_qualifiers_t < }; #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 #undef BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE @@ -69,7 +69,7 @@ struct set_varargs_member_function_qualifiers_t < #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 #endif diff --git a/include/boost/callable_traits/detail/unguarded/pmf_varargs_3.hpp b/include/boost/callable_traits/detail/unguarded/pmf_varargs_3.hpp index 905a5a6..325e26c 100644 --- a/include/boost/callable_traits/detail/unguarded/pmf_varargs_3.hpp +++ b/include/boost/callable_traits/detail/unguarded/pmf_varargs_3.hpp @@ -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 #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 #undef BOOST_CLBL_TRTS_NOEXCEPT_SPEC #undef BOOST_CLBL_TRTS_IS_NOEXCEPT -#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES \ No newline at end of file +#endif // #ifdef BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES diff --git a/include/boost/callable_traits/detail/unguarded/pmf_varargs_4.hpp b/include/boost/callable_traits/detail/unguarded/pmf_varargs_4.hpp index ca33ebf..e57c969 100644 --- a/include/boost/callable_traits/detail/unguarded/pmf_varargs_4.hpp +++ b/include/boost/callable_traits/detail/unguarded/pmf_varargs_4.hpp @@ -13,7 +13,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 @@ -22,7 +22,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 @@ -38,7 +38,7 @@ struct pmf using set_qualifiers = set_varargs_member_function_qualifiers< - Flags, is_transaction_safe::value, is_noexcept::value, + Flags, is_transaction_safe, is_noexcept, BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...>; using remove_member_reference = set_qualifiers; @@ -144,6 +144,4 @@ struct pmf class Container> using expand_args = Container; - - using is_member_pointer = std::true_type; }; diff --git a/include/boost/callable_traits/has_member_qualifiers.hpp b/include/boost/callable_traits/has_member_qualifiers.hpp index 3ab44d3..01fe015 100644 --- a/include/boost/callable_traits/has_member_qualifiers.hpp +++ b/include/boost/callable_traits/has_member_qualifiers.hpp @@ -26,12 +26,9 @@ struct has_member_qualifiers; //<- template -struct has_member_qualifiers : detail::traits< - detail::shallow_decay>::has_member_qualifiers { - - using type = typename detail::traits< - detail::shallow_decay>::has_member_qualifiers; -}; +struct has_member_qualifiers : detail::bool_type< + detail::traits>::has_member_qualifiers> +{ }; // older compilers don't support variable templates #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -51,7 +48,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool has_member_qualifiers_v = //see below //<- - detail::traits>::has_member_qualifiers::value; + detail::traits>::has_member_qualifiers; #endif diff --git a/include/boost/callable_traits/has_varargs.hpp b/include/boost/callable_traits/has_varargs.hpp index 7f79824..e1d6eae 100644 --- a/include/boost/callable_traits/has_varargs.hpp +++ b/include/boost/callable_traits/has_varargs.hpp @@ -27,12 +27,9 @@ struct has_varargs; //<- template -struct has_varargs : detail::traits< - detail::shallow_decay>::has_varargs { - - using type = typename detail::traits< - detail::shallow_decay>::has_varargs; -}; +struct has_varargs : detail::bool_type< + detail::traits>::has_varargs> +{ }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -51,7 +48,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool has_varargs_v = //see below //<- - detail::traits>::has_varargs::value; + detail::traits>::has_varargs; #endif diff --git a/include/boost/callable_traits/is_const_member.hpp b/include/boost/callable_traits/is_const_member.hpp index f0a7ad2..ced6cbd 100644 --- a/include/boost/callable_traits/is_const_member.hpp +++ b/include/boost/callable_traits/is_const_member.hpp @@ -26,11 +26,9 @@ struct is_const_member; //<- template -struct is_const_member - : detail::traits>::is_const_member { - using type = typename detail::traits< - detail::shallow_decay>::is_const_member; -}; +struct is_const_member : detail::bool_type< + detail::traits>::is_const_member> +{ }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -49,7 +47,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool is_const_member_v = //see below //<- - detail::traits>::is_const_member::value; + detail::traits>::is_const_member; #endif diff --git a/include/boost/callable_traits/is_cv_member.hpp b/include/boost/callable_traits/is_cv_member.hpp index 6e95545..6f6e659 100644 --- a/include/boost/callable_traits/is_cv_member.hpp +++ b/include/boost/callable_traits/is_cv_member.hpp @@ -26,11 +26,9 @@ struct is_cv_member; //<- template -struct is_cv_member - : detail::traits>::is_cv_member { - using type = typename detail::traits< - detail::shallow_decay>::is_cv_member; -}; +struct is_cv_member : detail::bool_type< + detail::traits>::is_cv_member> +{ }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -49,7 +47,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool is_cv_member_v = //see below //<- - detail::traits>::is_cv_member::value; + detail::traits>::is_cv_member; #endif diff --git a/include/boost/callable_traits/is_lvalue_reference_member.hpp b/include/boost/callable_traits/is_lvalue_reference_member.hpp index 89500cb..cf60bd2 100644 --- a/include/boost/callable_traits/is_lvalue_reference_member.hpp +++ b/include/boost/callable_traits/is_lvalue_reference_member.hpp @@ -27,11 +27,9 @@ struct is_lvalue_reference_member; //<- template -struct is_lvalue_reference_member - : detail::traits>::is_lvalue_reference_member { - using type = typename detail::traits< - detail::shallow_decay>::is_lvalue_reference_member; -}; +struct is_lvalue_reference_member : detail::bool_type< + detail::traits>::is_lvalue_reference_member> +{ }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -50,7 +48,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool is_lvalue_reference_member_v = //see below //<- - detail::traits>::is_lvalue_reference_member::value; + detail::traits>::is_lvalue_reference_member; #endif diff --git a/include/boost/callable_traits/is_noexcept.hpp b/include/boost/callable_traits/is_noexcept.hpp index 36320f6..b4e0e7e 100644 --- a/include/boost/callable_traits/is_noexcept.hpp +++ b/include/boost/callable_traits/is_noexcept.hpp @@ -27,10 +27,9 @@ struct is_noexcept; //<- template -struct is_noexcept : detail::traits>::is_noexcept { - using type = typename detail::traits< - detail::shallow_decay>::is_noexcept; -}; +struct is_noexcept : detail::bool_type< + detail::traits>::is_noexcept> +{ }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -49,7 +48,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool is_noexcept_v = //see below //<- - detail::traits>::is_noexcept::value; + detail::traits>::is_noexcept; #endif diff --git a/include/boost/callable_traits/is_reference_member.hpp b/include/boost/callable_traits/is_reference_member.hpp index ef893a0..c45a091 100644 --- a/include/boost/callable_traits/is_reference_member.hpp +++ b/include/boost/callable_traits/is_reference_member.hpp @@ -28,12 +28,9 @@ struct is_reference_member; //<- template -struct is_reference_member : detail::traits< - detail::shallow_decay>::is_reference_member { - - using type = typename detail::traits< - detail::shallow_decay>::is_reference_member; -}; +struct is_reference_member : detail::bool_type< + detail::traits>::is_reference_member> +{ }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -52,7 +49,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool is_reference_member_v = //see below //<- - detail::traits>::is_reference_member::value; + detail::traits>::is_reference_member; #endif diff --git a/include/boost/callable_traits/is_rvalue_reference_member.hpp b/include/boost/callable_traits/is_rvalue_reference_member.hpp index a852ce6..e4c80c8 100644 --- a/include/boost/callable_traits/is_rvalue_reference_member.hpp +++ b/include/boost/callable_traits/is_rvalue_reference_member.hpp @@ -28,12 +28,9 @@ struct is_rvalue_reference_member; //<- template -struct is_rvalue_reference_member : detail::traits< - detail::shallow_decay>::is_rvalue_reference_member { - - using type = typename detail::traits< - detail::shallow_decay>::is_rvalue_reference_member; -}; +struct is_rvalue_reference_member : detail::bool_type< + detail::traits>::is_rvalue_reference_member> +{ }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -52,7 +49,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool is_rvalue_reference_member_v = //see below //<- - detail::traits>::is_rvalue_reference_member::value; + detail::traits>::is_rvalue_reference_member; #endif diff --git a/include/boost/callable_traits/is_transaction_safe.hpp b/include/boost/callable_traits/is_transaction_safe.hpp index 51c98c5..739c215 100644 --- a/include/boost/callable_traits/is_transaction_safe.hpp +++ b/include/boost/callable_traits/is_transaction_safe.hpp @@ -28,12 +28,9 @@ struct is_transaction_safe; //<- template -struct is_transaction_safe : detail::traits< - detail::shallow_decay>::is_transaction_safe { - - using type = typename detail::traits< - detail::shallow_decay>::is_transaction_safe; -}; +struct is_transaction_safe : detail::bool_type< + detail::traits>::is_transaction_safe> +{ }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -52,7 +49,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool is_transaction_safe_v = //see below //<- - detail::traits>::is_transaction_safe::value; + detail::traits>::is_transaction_safe; #endif diff --git a/include/boost/callable_traits/is_volatile_member.hpp b/include/boost/callable_traits/is_volatile_member.hpp index 2309eec..d4ecf51 100644 --- a/include/boost/callable_traits/is_volatile_member.hpp +++ b/include/boost/callable_traits/is_volatile_member.hpp @@ -28,12 +28,9 @@ struct is_volatile_member; //<- template -struct is_volatile_member : detail::traits< - detail::shallow_decay>::is_volatile_member { - - using type = typename detail::traits< - detail::shallow_decay>::is_volatile_member; -}; +struct is_volatile_member : detail::bool_type< + detail::traits>::is_volatile_member> +{ }; #ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES @@ -52,7 +49,7 @@ BOOST_CLBL_TRAITS_INLINE_VAR //-> constexpr bool is_volatile_member_v = //see below //<- - detail::traits>::is_volatile_member::value; + detail::traits>::is_volatile_member; #endif