2 Copyright (c) 2016 Barrett Adair
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
7 HEADER GUARDS INTENTIONALLY OMITTED
8 DO NOT INCLUDE THIS HEADER DIRECTLY
10 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS - the function-level qualifiers for the
11 current inclusion (combinations of `const` `volatile` `&` `&&`, or nothing)
13 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
14 the current include (`transaction_safe` or nothing)
16 BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
17 tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`
19 BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
20 BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE is enabled, otherwise nothing
22 BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
23 the current include (`noexcept` or nothing)
25 BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
26 tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`
28 BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
29 BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES is defined, otherwise nothing
32 template<typename Return, typename T, typename... Args>
33 struct pmf<Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
34 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
35 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
36 BOOST_CLBL_TRTS_NOEXCEPT_SPEC>
37 : default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS> {
39 static constexpr bool value = true;
41 using has_varargs = std::true_type;
45 using return_type = Return;
47 using type = Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
48 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
49 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
50 BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
52 using invoke_type = typename std::conditional<
53 std::is_rvalue_reference<T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
54 T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS,
55 typename std::add_lvalue_reference<T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::type
58 using arg_types = std::tuple<invoke_type, Args...>;
59 using non_invoke_arg_types = std::tuple<Args...>;
61 using function_object_signature = Return(Args..., ...);
63 using function_type = Return(invoke_type, Args..., ...);
65 using qualified_function_type = Return(Args..., ...)
66 BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
67 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
68 BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
70 using remove_varargs =
71 Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
72 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
73 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
74 BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
76 using add_varargs = type;
78 using is_noexcept = BOOST_CLBL_TRTS_IS_NOEXCEPT;
80 using remove_noexcept = Return(BOOST_CLBL_TRTS_CC T::*)(Args..., ...)
81 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
82 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE;
84 using add_noexcept = Return(BOOST_CLBL_TRTS_CC T::*)(Args..., ...)
85 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
86 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
87 BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER;
89 using is_transaction_safe = BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE;
91 using remove_transaction_safe = Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
92 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
93 BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
95 using add_transaction_safe = Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
96 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
97 BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
98 BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
100 using class_type = T;
102 using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;
104 template<qualifier_flags Flags>
105 using set_qualifiers = set_varargs_member_function_qualifiers<
106 Flags, is_transaction_safe::value, is_noexcept::value,
107 BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...>;
109 using remove_member_reference = set_qualifiers<qualifiers::cv_flags>;
111 using add_member_lvalue_reference = set_qualifiers<
112 collapse_flags<qualifiers::q_flags, lref_>::value>;
114 using add_member_rvalue_reference = set_qualifiers<
115 collapse_flags<qualifiers::q_flags, rref_>::value>;
117 using add_member_const = set_qualifiers<qualifiers::q_flags | const_>;
119 using add_member_volatile = set_qualifiers<qualifiers::q_flags | volatile_>;
121 using add_member_cv = set_qualifiers<qualifiers::q_flags | cv_>;
123 using remove_member_const = set_qualifiers<
124 qualifiers::ref_flags | remove_const_flag<qualifiers::cv_flags>::value>;
126 using remove_member_volatile = set_qualifiers<
127 qualifiers::ref_flags | remove_volatile_flag<qualifiers::cv_flags>::value>;
129 using remove_member_cv = set_qualifiers<qualifiers::ref_flags>;
132 using apply_member_pointer =
133 Return(BOOST_CLBL_TRTS_VARARGS_CC U::*)(Args..., ...)
134 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
135 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
136 BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
138 template<typename NewReturn>
140 NewReturn(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
141 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
142 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
143 BOOST_CLBL_TRTS_NOEXCEPT_SPEC;
145 template<template<class...> class Container>
146 using expand_args = Container<invoke_type, Args...>;
148 using is_member_pointer = std::true_type;