From 27ebf60afe433ab4da2223a12b85d88626be806b Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Thu, 25 Sep 2025 14:25:34 -0500 Subject: [PATCH 1/3] Remove std::index_sequence polyfill, unused --- .../boost/callable_traits/detail/config.hpp | 6 --- .../detail/polyfills/make_index_sequence.hpp | 50 ------------------- 2 files changed, 56 deletions(-) delete mode 100644 include/boost/callable_traits/detail/polyfills/make_index_sequence.hpp diff --git a/include/boost/callable_traits/detail/config.hpp b/include/boost/callable_traits/detail/config.hpp index 6b3d2ea..fd64212 100644 --- a/include/boost/callable_traits/detail/config.hpp +++ b/include/boost/callable_traits/detail/config.hpp @@ -65,8 +65,6 @@ Distributed under the Boost Software License, Version 1.0. # endif // #if !defined( __clang__ ) #endif // #ifdef _MSC_VER -#define BOOST_CLBL_TRTS_IX_SEQ(...) ::std::index_sequence< __VA_ARGS__ > -#define BOOST_CLBL_TRTS_MAKE_IX_SEQ(...) ::std::make_index_sequence< __VA_ARGS__ > #define BOOST_CLBL_TRTS_DISJUNCTION(...) ::std::disjunction< __VA_ARGS__ > #ifndef __cpp_variable_templates @@ -77,10 +75,6 @@ Distributed under the Boost Software License, Version 1.0. # include #endif //__cpp_lib_logical_traits -#ifndef __cpp_lib_integer_sequence -# include -#endif // __cpp_lib_integer_sequence - #if defined(BOOST_CLBL_TRTS_MSVC) && !defined(BOOST_DISABLE_WIN32) # define BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC __cdecl # define BOOST_CLBL_TRTS_PMF_VARGARGS_CDECL_DEFAULT diff --git a/include/boost/callable_traits/detail/polyfills/make_index_sequence.hpp b/include/boost/callable_traits/detail/polyfills/make_index_sequence.hpp deleted file mode 100644 index a4a6e82..0000000 --- a/include/boost/callable_traits/detail/polyfills/make_index_sequence.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright Barrett Adair 2016-2017 - -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_MAKE_INDEX_SEQUENCE_HPP -#define BOOST_CLBL_TRTS_DETAIL_POLYFILLS_MAKE_INDEX_SEQUENCE_HPP - -#undef BOOST_CLBL_TRTS_IX_SEQ -#define BOOST_CLBL_TRTS_IX_SEQ(...) \ - ::boost::callable_traits::detail::index_sequence<__VA_ARGS__> - -#undef BOOST_CLBL_TRTS_MAKE_IX_SEQ -#define BOOST_CLBL_TRTS_MAKE_IX_SEQ(...) \ - ::boost::callable_traits::detail::make_index_sequence<__VA_ARGS__> - -namespace boost { namespace callable_traits { namespace detail { - -template -struct index_sequence { using type = index_sequence; }; - -template -struct concat; - -template -struct concat, index_sequence> - : index_sequence {}; - -template - struct make_index_sequence_t; - -template -struct make_index_sequence_t : concat< - typename make_index_sequence_t::type, - typename make_index_sequence_t::type >::type {}; - -template<> -struct make_index_sequence_t<0> : index_sequence<> {}; - -template<> -struct make_index_sequence_t<1> : index_sequence<0> {}; - -template -using make_index_sequence = typename make_index_sequence_t::type; - -}}} // namespace boost::callable_traits::detail - -#endif // #ifndef BOOST_CLBL_TRTS_DETAIL_POLYFILLS_MAKE_INDEX_SEQUENCE_HPP From befd80b453f328d3da51da23c65c0623a9870300 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Thu, 25 Sep 2025 14:31:37 -0500 Subject: [PATCH 2/3] Require C++14 variable templates unconditionally --- example/intro.cpp | 4 ---- include/boost/callable_traits/detail/config.hpp | 4 ---- .../callable_traits/has_member_qualifiers.hpp | 12 ------------ include/boost/callable_traits/has_varargs.hpp | 11 ----------- .../boost/callable_traits/has_void_return.hpp | 11 ----------- .../boost/callable_traits/is_const_member.hpp | 11 ----------- include/boost/callable_traits/is_cv_member.hpp | 11 ----------- include/boost/callable_traits/is_invocable.hpp | 16 ---------------- .../is_lvalue_reference_member.hpp | 11 ----------- include/boost/callable_traits/is_noexcept.hpp | 11 ----------- .../callable_traits/is_reference_member.hpp | 11 ----------- .../is_rvalue_reference_member.hpp | 11 ----------- .../callable_traits/is_transaction_safe.hpp | 11 ----------- .../boost/callable_traits/is_volatile_member.hpp | 11 ----------- test/is_invocable.cpp | 4 ---- test/is_invocable_r.cpp | 4 ---- 16 files changed, 154 deletions(-) diff --git a/example/intro.cpp b/example/intro.cpp index a1e0509..6cca612 100644 --- a/example/intro.cpp +++ b/example/intro.cpp @@ -5,9 +5,6 @@ Distributed under the Boost Software License, Version 1.0. ->*/ #include -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES -int main(){ return 0; } -#else //[ intro #include @@ -59,4 +56,3 @@ int main() { } //] -#endif diff --git a/include/boost/callable_traits/detail/config.hpp b/include/boost/callable_traits/detail/config.hpp index fd64212..73e5709 100644 --- a/include/boost/callable_traits/detail/config.hpp +++ b/include/boost/callable_traits/detail/config.hpp @@ -67,10 +67,6 @@ Distributed under the Boost Software License, Version 1.0. #define BOOST_CLBL_TRTS_DISJUNCTION(...) ::std::disjunction< __VA_ARGS__ > -#ifndef __cpp_variable_templates -# define BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES -#endif - #ifndef __cpp_lib_logical_traits # include #endif //__cpp_lib_logical_traits diff --git a/include/boost/callable_traits/has_member_qualifiers.hpp b/include/boost/callable_traits/has_member_qualifiers.hpp index 3ab44d3..c485e92 100644 --- a/include/boost/callable_traits/has_member_qualifiers.hpp +++ b/include/boost/callable_traits/has_member_qualifiers.hpp @@ -33,16 +33,6 @@ struct has_member_qualifiers : detail::traits< detail::shallow_decay>::has_member_qualifiers; }; -// older compilers don't support variable templates -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct has_member_qualifiers_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -53,8 +43,6 @@ constexpr bool has_member_qualifiers_v = //see below //<- detail::traits>::has_member_qualifiers::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/has_varargs.hpp b/include/boost/callable_traits/has_varargs.hpp index 7f79824..c04ff0a 100644 --- a/include/boost/callable_traits/has_varargs.hpp +++ b/include/boost/callable_traits/has_varargs.hpp @@ -34,15 +34,6 @@ struct has_varargs : detail::traits< detail::shallow_decay>::has_varargs; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct has_varargs_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -53,8 +44,6 @@ constexpr bool has_varargs_v = //see below //<- detail::traits>::has_varargs::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/has_void_return.hpp b/include/boost/callable_traits/has_void_return.hpp index 06f80f3..7008d31 100644 --- a/include/boost/callable_traits/has_void_return.hpp +++ b/include/boost/callable_traits/has_void_return.hpp @@ -30,15 +30,6 @@ struct has_void_return : std::is_same>::return_type, void> {}; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct has_void_return_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported @@ -51,8 +42,6 @@ constexpr bool has_void_return_v = //see below std::is_same>::return_type, void>::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/is_const_member.hpp b/include/boost/callable_traits/is_const_member.hpp index f0a7ad2..be107d1 100644 --- a/include/boost/callable_traits/is_const_member.hpp +++ b/include/boost/callable_traits/is_const_member.hpp @@ -32,15 +32,6 @@ struct is_const_member detail::shallow_decay>::is_const_member; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct is_const_member_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -51,8 +42,6 @@ constexpr bool is_const_member_v = //see below //<- detail::traits>::is_const_member::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/is_cv_member.hpp b/include/boost/callable_traits/is_cv_member.hpp index 6e95545..23f9e1e 100644 --- a/include/boost/callable_traits/is_cv_member.hpp +++ b/include/boost/callable_traits/is_cv_member.hpp @@ -32,15 +32,6 @@ struct is_cv_member detail::shallow_decay>::is_cv_member; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct is_cv_member_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -51,8 +42,6 @@ constexpr bool is_cv_member_v = //see below //<- detail::traits>::is_cv_member::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/is_invocable.hpp b/include/boost/callable_traits/is_invocable.hpp index fbba68f..a924377 100644 --- a/include/boost/callable_traits/is_invocable.hpp +++ b/include/boost/callable_traits/is_invocable.hpp @@ -44,21 +44,6 @@ struct is_invocable_r typename detail::is_invocable_impl::type, Ret, T, Args...>::type; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct is_invocable_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -template -struct is_invocable_r_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -80,7 +65,6 @@ constexpr bool is_invocable_r_v = //see below detail::is_invocable_r_impl< typename detail::is_invocable_impl::type, Ret, T, Args...>::type::value; -#endif }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/is_lvalue_reference_member.hpp b/include/boost/callable_traits/is_lvalue_reference_member.hpp index 89500cb..9de2f2f 100644 --- a/include/boost/callable_traits/is_lvalue_reference_member.hpp +++ b/include/boost/callable_traits/is_lvalue_reference_member.hpp @@ -33,15 +33,6 @@ struct is_lvalue_reference_member detail::shallow_decay>::is_lvalue_reference_member; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct is_lvalue_reference_member_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -52,8 +43,6 @@ constexpr bool is_lvalue_reference_member_v = //see below //<- detail::traits>::is_lvalue_reference_member::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/is_noexcept.hpp b/include/boost/callable_traits/is_noexcept.hpp index 36320f6..72d4c8b 100644 --- a/include/boost/callable_traits/is_noexcept.hpp +++ b/include/boost/callable_traits/is_noexcept.hpp @@ -32,15 +32,6 @@ struct is_noexcept : detail::traits>::is_noexcept { detail::shallow_decay>::is_noexcept; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct is_noexcept_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -51,8 +42,6 @@ constexpr bool is_noexcept_v = //see below //<- detail::traits>::is_noexcept::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/is_reference_member.hpp b/include/boost/callable_traits/is_reference_member.hpp index ef893a0..6d5e102 100644 --- a/include/boost/callable_traits/is_reference_member.hpp +++ b/include/boost/callable_traits/is_reference_member.hpp @@ -35,15 +35,6 @@ struct is_reference_member : detail::traits< detail::shallow_decay>::is_reference_member; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct is_reference_member_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -54,8 +45,6 @@ constexpr bool is_reference_member_v = //see below //<- detail::traits>::is_reference_member::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/is_rvalue_reference_member.hpp b/include/boost/callable_traits/is_rvalue_reference_member.hpp index a852ce6..3a72f2c 100644 --- a/include/boost/callable_traits/is_rvalue_reference_member.hpp +++ b/include/boost/callable_traits/is_rvalue_reference_member.hpp @@ -35,15 +35,6 @@ struct is_rvalue_reference_member : detail::traits< detail::shallow_decay>::is_rvalue_reference_member; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct is_rvalue_reference_member_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -54,8 +45,6 @@ constexpr bool is_rvalue_reference_member_v = //see below //<- detail::traits>::is_rvalue_reference_member::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/is_transaction_safe.hpp b/include/boost/callable_traits/is_transaction_safe.hpp index 51c98c5..b8ff4a0 100644 --- a/include/boost/callable_traits/is_transaction_safe.hpp +++ b/include/boost/callable_traits/is_transaction_safe.hpp @@ -35,15 +35,6 @@ struct is_transaction_safe : detail::traits< detail::shallow_decay>::is_transaction_safe; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct is_transaction_safe_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -54,8 +45,6 @@ constexpr bool is_transaction_safe_v = //see below //<- detail::traits>::is_transaction_safe::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/include/boost/callable_traits/is_volatile_member.hpp b/include/boost/callable_traits/is_volatile_member.hpp index 2309eec..f91ac3a 100644 --- a/include/boost/callable_traits/is_volatile_member.hpp +++ b/include/boost/callable_traits/is_volatile_member.hpp @@ -35,15 +35,6 @@ struct is_volatile_member : detail::traits< detail::shallow_decay>::is_volatile_member; }; -#ifdef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES - -template -struct is_volatile_member_v { - static_assert(std::is_same::value, - "Variable templates not supported on this compiler."); -}; - -#else //-> // only available when variable templates are supported template @@ -54,8 +45,6 @@ constexpr bool is_volatile_member_v = //see below //<- detail::traits>::is_volatile_member::value; -#endif - }} // namespace boost::callable_traits //-> diff --git a/test/is_invocable.cpp b/test/is_invocable.cpp index e7dfe8c..5da1a57 100644 --- a/test/is_invocable.cpp +++ b/test/is_invocable.cpp @@ -26,16 +26,12 @@ struct invoke_case { void operator()(tag) const { CT_ASSERT((Expect == boost::callable_traits::is_invocable())); -#ifndef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES CT_ASSERT((Expect == boost::callable_traits::is_invocable_v)); -#endif // when available, test parity with std implementation #if defined(__cpp_lib_is_invocable) CT_ASSERT((std::is_invocable() == boost::callable_traits::is_invocable())); -# ifndef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES CT_ASSERT((std::is_invocable_v == boost::callable_traits::is_invocable_v)); -# endif #endif } diff --git a/test/is_invocable_r.cpp b/test/is_invocable_r.cpp index 128bf8f..800b1f1 100644 --- a/test/is_invocable_r.cpp +++ b/test/is_invocable_r.cpp @@ -26,16 +26,12 @@ struct invoke_case { void operator()(tag) const { CT_ASSERT((Expect == boost::callable_traits::is_invocable_r())); -#ifndef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES CT_ASSERT((Expect == boost::callable_traits::is_invocable_r_v)); -#endif // when available, test parity with std implementation #if defined(__cpp_lib_is_invocable) CT_ASSERT((std::is_invocable_r() == boost::callable_traits::is_invocable_r())); -# ifndef BOOST_CLBL_TRTS_DISABLE_VARIABLE_TEMPLATES CT_ASSERT((std::is_invocable_r_v == boost::callable_traits::is_invocable_r_v)); -# endif #endif } From 2bb577771995ef392de663be048b8f0276f195b7 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Thu, 25 Sep 2025 15:04:19 -0500 Subject: [PATCH 3/3] Use the _t suffix for various standard library type traits --- example/is_invocable.cpp | 2 +- .../callable_traits/apply_member_pointer.hpp | 2 +- .../detail/default_callable_traits.hpp | 14 ++++++------- .../detail/forward_declarations.hpp | 10 ++++----- .../boost/callable_traits/detail/function.hpp | 2 +- .../detail/function_object.hpp | 7 +++---- .../detail/is_invocable_impl.hpp | 6 +++--- .../detail/parameter_index_helper.hpp | 16 +++++++------- include/boost/callable_traits/detail/pmd.hpp | 4 ++-- .../detail/polyfills/disjunction.hpp | 2 +- .../detail/qualifier_flags.hpp | 2 +- .../callable_traits/detail/sfinae_errors.hpp | 4 ++-- .../detail/unguarded/pmf_4.hpp | 6 +++--- .../detail/unguarded/pmf_varargs_4.hpp | 6 +++--- .../boost/callable_traits/detail/utility.hpp | 21 +++++++++---------- test/add_noexcept_constraints.cpp | 4 ++-- test/add_transaction_safe_constraints.cpp | 4 ++-- test/add_varargs_constraints.cpp | 4 ++-- test/apply_member_pointer_constraints.cpp | 4 ++-- test/class_of_constraints.cpp | 4 ++-- test/function_type_constraints.cpp | 4 ++-- test/qualified_class_of_constraints.cpp | 4 ++-- test/qualifier_metafunction_constraints.hpp | 4 ++-- test/remove_noexcept_constraints.cpp | 4 ++-- test/remove_transaction_safe_constraints.cpp | 4 ++-- test/remove_varargs_constraints.hpp | 4 ++-- 26 files changed, 73 insertions(+), 75 deletions(-) diff --git a/example/is_invocable.cpp b/example/is_invocable.cpp index a374de0..5d8508c 100644 --- a/example/is_invocable.cpp +++ b/example/is_invocable.cpp @@ -13,7 +13,7 @@ namespace ct = boost::callable_traits; struct foo { template - typename std::enable_if::value>::type + std::enable_if_t::value> operator()(T){} }; diff --git a/include/boost/callable_traits/apply_member_pointer.hpp b/include/boost/callable_traits/apply_member_pointer.hpp index efd3f95..54983fe 100644 --- a/include/boost/callable_traits/apply_member_pointer.hpp +++ b/include/boost/callable_traits/apply_member_pointer.hpp @@ -24,7 +24,7 @@ namespace detail { template struct make_member_pointer { - using type = typename std::remove_reference::type C::*; + using type = std::remove_reference_t C::*; }; template diff --git a/include/boost/callable_traits/detail/default_callable_traits.hpp b/include/boost/callable_traits/detail/default_callable_traits.hpp index 8497078..2985714 100644 --- a/include/boost/callable_traits/detail/default_callable_traits.hpp +++ b/include/boost/callable_traits/detail/default_callable_traits.hpp @@ -132,14 +132,14 @@ struct default_callable_traits { // everything else into member data pointers. template::type, - typename L = typename std::conditional< - std::is_same::value, error_t, K>::type, - typename Class = typename std::conditional< - std::is_class::value, C, error_t>::type> - using apply_member_pointer = typename std::conditional< + typename K = std::remove_reference_t, + typename L = std::conditional_t< + std::is_same::value, error_t, K>, + typename Class = std::conditional_t< + std::is_class_v, C, error_t>> + using apply_member_pointer = std::conditional_t< std::is_same::value || std::is_same::value, - error_t, L Class::*>::type; + error_t, L Class::*>; // Changes the return type of PMFs, function pointers, function // references, and qualified/unqualified function types. Changes diff --git a/include/boost/callable_traits/detail/forward_declarations.hpp b/include/boost/callable_traits/detail/forward_declarations.hpp index 9327759..e195571 100644 --- a/include/boost/callable_traits/detail/forward_declarations.hpp +++ b/include/boost/callable_traits/detail/forward_declarations.hpp @@ -30,9 +30,9 @@ struct callable_dummy { }; template -using default_to_function_object = typename std::conditional< +using default_to_function_object = std::conditional_t< has_normal_call_operator::value, - T, callable_dummy>::type; + T, callable_dummy>; template struct pmf; @@ -40,11 +40,11 @@ struct pmf; template struct pmd; -template::type> -using function_object_base = typename std::conditional< +template> +using function_object_base = std::conditional_t< has_normal_call_operator::value, pmf::operator())>, - default_callable_traits>::type; + default_callable_traits>; template> struct function_object; diff --git a/include/boost/callable_traits/detail/function.hpp b/include/boost/callable_traits/detail/function.hpp index 624c704..424cb16 100644 --- a/include/boost/callable_traits/detail/function.hpp +++ b/include/boost/callable_traits/detail/function.hpp @@ -142,7 +142,7 @@ template struct function : std::conditional::value, function, default_callable_traits>::type { - static constexpr const bool value = !std::is_pointer::value; + static constexpr const bool value = !std::is_pointer_v; using traits = function; using base = function; diff --git a/include/boost/callable_traits/detail/function_object.hpp b/include/boost/callable_traits/detail/function_object.hpp index d12fc00..c1ee6a7 100644 --- a/include/boost/callable_traits/detail/function_object.hpp +++ b/include/boost/callable_traits/detail/function_object.hpp @@ -25,8 +25,8 @@ struct function_object : Base { using arg_types = typename Base::non_invoke_arg_types; using non_invoke_arg_types = arg_types; - static constexpr const bool value = std::is_class< - typename std::remove_reference::type>::value; + static constexpr const bool value = std::is_class_v< + std::remove_reference_t>; using traits = function_object; using class_type = error_t; @@ -54,8 +54,7 @@ struct function_object : Base { expand_args_right; template - using apply_member_pointer = - typename std::remove_reference::type C::*; + using apply_member_pointer = std::remove_reference_t C::*; template using apply_return = 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..76d298d 100644 --- a/include/boost/callable_traits/detail/is_invocable_impl.hpp +++ b/include/boost/callable_traits/detail/is_invocable_impl.hpp @@ -26,7 +26,7 @@ namespace boost { namespace callable_traits { namespace detail { template static std::int8_t test( - check())>::type>* + check())>>* ); template @@ -69,8 +69,8 @@ namespace boost { namespace callable_traits { namespace detail { template>, typename IsSame = std::is_same>> - using generalize_if_dissimilar = typename std::conditional< - IsBaseOf::value || IsSame::value, T, generalize>::type; + using generalize_if_dissimilar = std::conditional_t< + IsBaseOf::value || IsSame::value, T, generalize>; template; - using args_tuple = typename std::conditional::non_invoke_arg_types, - typename detail::traits::arg_types>::type; + typename detail::traits::arg_types>; static constexpr bool has_parameter_list = !std::is_same::value && !std::is_same::value; - using temp_tuple = typename std::conditional>::type; + using temp_tuple = std::conditional_t>; static constexpr std::size_t parameter_list_size = std::tuple_size::value; @@ -37,13 +37,13 @@ struct parameter_index_helper { static constexpr std::size_t count = has_parameter_list && !is_count_out_of_range ? Count : 0; - using permissive_tuple = typename std::conditional< + using permissive_tuple = std::conditional_v< has_parameter_list && !is_out_of_range, - args_tuple, std::tuple>::type; + args_tuple, std::tuple>; - using permissive_function = typename std::conditional< + using permissive_function = std::conditional_v< has_parameter_list && !is_out_of_range, - T, error_t(error_t)>::type; + T, error_t(error_t)>; }; }}} // namespace boost::callable_traits::detail diff --git a/include/boost/callable_traits/detail/pmd.hpp b/include/boost/callable_traits/detail/pmd.hpp index 13a2c44..bf398cc 100644 --- a/include/boost/callable_traits/detail/pmd.hpp +++ b/include/boost/callable_traits/detail/pmd.hpp @@ -29,12 +29,12 @@ struct pmd : default_callable_traits<> { using class_type = T; using invoke_type = T const &; using type = D T::*; - using function_type = typename std::add_lvalue_reference::type(invoke_type); + using function_type = std::add_lvalue_reference_t(invoke_type); using qualified_function_type = D(invoke_type); using arg_types = std::tuple; using non_invoke_arg_types = std::tuple<>; - using return_type = typename std::add_lvalue_reference::type; + using return_type = std::add_lvalue_reference_t; template using apply_member_pointer = D C::*; diff --git a/include/boost/callable_traits/detail/polyfills/disjunction.hpp b/include/boost/callable_traits/detail/polyfills/disjunction.hpp index dc4f65c..4ab96d8 100644 --- a/include/boost/callable_traits/detail/polyfills/disjunction.hpp +++ b/include/boost/callable_traits/detail/polyfills/disjunction.hpp @@ -24,7 +24,7 @@ struct disjunction : T {}; template struct disjunction - : std::conditional>::type {}; + : std::conditional_t> {}; }}} // namespace boost::callable_traits::detail diff --git a/include/boost/callable_traits/detail/qualifier_flags.hpp b/include/boost/callable_traits/detail/qualifier_flags.hpp index f69d246..18cd9ec 100644 --- a/include/boost/callable_traits/detail/qualifier_flags.hpp +++ b/include/boost/callable_traits/detail/qualifier_flags.hpp @@ -81,7 +81,7 @@ template using remove_volatile_flag = std::integral_constant< qualifier_flags, Flags & ~volatile_>; -template::type> +template> using cv_of = std::integral_constant::value ? const_ : default_) | (std::is_volatile::value ? volatile_ : default_)>; diff --git a/include/boost/callable_traits/detail/sfinae_errors.hpp b/include/boost/callable_traits/detail/sfinae_errors.hpp index 485d172..0a001db 100644 --- a/include/boost/callable_traits/detail/sfinae_errors.hpp +++ b/include/boost/callable_traits/detail/sfinae_errors.hpp @@ -35,8 +35,8 @@ namespace boost { namespace callable_traits { namespace detail { template struct fail { - using type = typename std::conditional::value, - FailMsg, FailMsg>::type::_::type; + using type = std::conditional_t::value, + FailMsg, FailMsg>::_::type; }; }}} // namespace boost::callable_traits::detail diff --git a/include/boost/callable_traits/detail/unguarded/pmf_4.hpp b/include/boost/callable_traits/detail/unguarded/pmf_4.hpp index 5a1f48c..38397c7 100644 --- a/include/boost/callable_traits/detail/unguarded/pmf_4.hpp +++ b/include/boost/callable_traits/detail/unguarded/pmf_4.hpp @@ -47,11 +47,11 @@ struct pmf::value, T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS, - typename std::add_lvalue_reference::type - >::type; + std::add_lvalue_reference_t + >; using arg_types = std::tuple; using non_invoke_arg_types = std::tuple; 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..28edf81 100644 --- a/include/boost/callable_traits/detail/unguarded/pmf_varargs_4.hpp +++ b/include/boost/callable_traits/detail/unguarded/pmf_varargs_4.hpp @@ -49,11 +49,11 @@ struct pmf::value, T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS, - typename std::add_lvalue_reference::type - >::type; + std::add_lvalue_reference_t + >; using arg_types = std::tuple; using non_invoke_arg_types = std::tuple; diff --git a/include/boost/callable_traits/detail/utility.hpp b/include/boost/callable_traits/detail/utility.hpp index d5a28cc..3b206a1 100644 --- a/include/boost/callable_traits/detail/utility.hpp +++ b/include/boost/callable_traits/detail/utility.hpp @@ -24,8 +24,8 @@ struct invalid_type { invalid_type() = delete; }; struct reference_error { reference_error() = delete; }; template -using error_type = typename std::conditional< - std::is_reference::value, reference_error, invalid_type>::type; +using error_type = std::conditional_t< + std::is_reference::value, reference_error, invalid_type>; #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS struct abominable_functions_not_supported_on_this_compiler{}; @@ -42,7 +42,7 @@ using bool_type = std::integral_constant; // shorthand for std::tuple_element template -using at = typename std::tuple_element::type; +using at = std::tuple_element_t; template using add_member_pointer = T Class::*; @@ -51,23 +51,23 @@ template using fail_when_same = fail_if::value, ErrorType>; template::type> + typename U = std::remove_reference_t> using try_but_fail_if_invalid = sfinae_try, fail_when_same>; template::type, + typename U = std::remove_reference_t, bool is_reference_error = std::is_same::value> using fail_if_invalid = fail_if< std::is_same::value || is_reference_error, - typename std::conditional::type>; + std::conditional_t>; template -using fallback_if_invalid = typename std::conditional< - std::is_same::value, Fallback, T>::type; +using fallback_if_invalid = std::conditional_t< + std::is_same::value, Fallback, T>; template class Alias, typename U = Alias> struct force_sfinae { @@ -75,8 +75,7 @@ struct force_sfinae { }; template -using shallow_decay = typename std::remove_cv< - typename std::remove_reference::type>::type; +using shallow_decay = std::remove_cv_t>; template struct is_reference_wrapper_t { diff --git a/test/add_noexcept_constraints.cpp b/test/add_noexcept_constraints.cpp index e6f59cb..a639314 100644 --- a/test/add_noexcept_constraints.cpp +++ b/test/add_noexcept_constraints.cpp @@ -23,8 +23,8 @@ struct is_substitution_failure_add_noexcept { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(add_noexcept, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/add_transaction_safe_constraints.cpp b/test/add_transaction_safe_constraints.cpp index bb74cdc..896586c 100644 --- a/test/add_transaction_safe_constraints.cpp +++ b/test/add_transaction_safe_constraints.cpp @@ -23,8 +23,8 @@ struct is_substitution_failure_add_tx_safe { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(add_transaction_safe, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/add_varargs_constraints.cpp b/test/add_varargs_constraints.cpp index baa63dc..e22ff91 100644 --- a/test/add_varargs_constraints.cpp +++ b/test/add_varargs_constraints.cpp @@ -19,8 +19,8 @@ struct is_substitution_failure_add_varargs { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(add_varargs, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/apply_member_pointer_constraints.cpp b/test/apply_member_pointer_constraints.cpp index 3b896aa..d94f7c6 100644 --- a/test/apply_member_pointer_constraints.cpp +++ b/test/apply_member_pointer_constraints.cpp @@ -17,8 +17,8 @@ struct is_substitution_failure_apply_member_pointer { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(apply_member_pointer, A, B)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/class_of_constraints.cpp b/test/class_of_constraints.cpp index 225a035..83b961e 100644 --- a/test/class_of_constraints.cpp +++ b/test/class_of_constraints.cpp @@ -19,8 +19,8 @@ struct is_substitution_failure_class_of { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(class_of, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/function_type_constraints.cpp b/test/function_type_constraints.cpp index 99570df..3ccb6cc 100644 --- a/test/function_type_constraints.cpp +++ b/test/function_type_constraints.cpp @@ -19,8 +19,8 @@ struct is_substitution_failure_function_type { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(function_type, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/qualified_class_of_constraints.cpp b/test/qualified_class_of_constraints.cpp index c86d511..da32b93 100644 --- a/test/qualified_class_of_constraints.cpp +++ b/test/qualified_class_of_constraints.cpp @@ -17,8 +17,8 @@ struct is_substitution_failure_qualified_class_of { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(qualified_class_of, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/qualifier_metafunction_constraints.hpp b/test/qualifier_metafunction_constraints.hpp index b3bf664..3dc6994 100644 --- a/test/qualifier_metafunction_constraints.hpp +++ b/test/qualifier_metafunction_constraints.hpp @@ -19,8 +19,8 @@ struct PP_CAT(is_sub_failure_, CALLABLE_TRAIT_UNDER_TEST) { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(CALLABLE_TRAIT_UNDER_TEST, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/remove_noexcept_constraints.cpp b/test/remove_noexcept_constraints.cpp index 9df96a4..5d428a9 100644 --- a/test/remove_noexcept_constraints.cpp +++ b/test/remove_noexcept_constraints.cpp @@ -21,8 +21,8 @@ struct is_substitution_failure_remove_noexcept { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(remove_noexcept, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/remove_transaction_safe_constraints.cpp b/test/remove_transaction_safe_constraints.cpp index 0daadeb..716a9ae 100644 --- a/test/remove_transaction_safe_constraints.cpp +++ b/test/remove_transaction_safe_constraints.cpp @@ -21,8 +21,8 @@ struct is_substitution_failure_remove_tx_safe { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(remove_transaction_safe, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value; diff --git a/test/remove_varargs_constraints.hpp b/test/remove_varargs_constraints.hpp index d891fba..959bd96 100644 --- a/test/remove_varargs_constraints.hpp +++ b/test/remove_varargs_constraints.hpp @@ -19,8 +19,8 @@ struct is_substitution_failure_remove_varargs { static auto test(...) -> std::true_type; template::type* = nullptr> + std::remove_reference_t< + TRAIT(add_varargs, A)>* = nullptr> static auto test(int) -> std::false_type; static constexpr bool value = decltype(test(0))::value;