pmf_4.hpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2016 Barrett Adair
3 
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)
6 
7 HEADER GUARDS INTENTIONALLY OMITTED
8 DO NOT INCLUDE THIS HEADER DIRECTLY
9 
10 BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS - the function-level qualifiers for the
11  current inclusion (combinations of `const` `volatile` `&` `&&`, or nothing)
12 
13 BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
14  the current include (`transaction_safe` or nothing)
15 
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`
18 
19 BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
20  BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE is defined, otherwise nothing
21 
22 BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
23  the current include (`noexcept` or nothing)
24 
25 BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
26  tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`
27 
28 BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
29  BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES is defined, otherwise nothing
30 */
31 
32 template<typename Return, typename T, typename... Args>
33 struct pmf<Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
37  : default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS> {
38 
39  static constexpr bool value = true;
40 
41  using traits = pmf;
42 
43  using return_type = Return;
44 
45  using type = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
49 
50  using invoke_type = typename std::conditional<
51  std::is_rvalue_reference<T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::value,
53  typename std::add_lvalue_reference<T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>::type
54  >::type;
55 
56  using arg_types = std::tuple<invoke_type, Args...>;
57  using non_invoke_arg_types = std::tuple<Args...>;
58 
59  using function_object_signature = Return(Args...);
60 
61  using function_type = Return(invoke_type, Args...);
62 
63  using qualified_function_type = Return(Args...)
67 
69 
70  using add_varargs =
71  Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args..., ...)
75 
77 
78  using remove_noexcept = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
81 
82  using add_noexcept = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
86 
88 
89  using remove_transaction_safe = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
92 
93  using add_transaction_safe = Return(BOOST_CLBL_TRTS_CC T::*)(Args...)
97 
98  using class_type = T;
99 
100  using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;
101 
102  template<qualifier_flags Flags>
104  Flags, is_transaction_safe::value, is_noexcept::value,
105  BOOST_CLBL_TRTS_CC_TAG, T, Return, Args...>;
106 
108 
110  collapse_flags<qualifiers::q_flags, lref_>::value>;
111 
113  collapse_flags<qualifiers::q_flags, rref_>::value>;
114 
116 
118 
120 
122  qualifiers::ref_flags | remove_const_flag<qualifiers::cv_flags>::value>;
123 
125  qualifiers::ref_flags | remove_volatile_flag<qualifiers::cv_flags>::value>;
126 
128 
129  template<typename U>
131  Return(BOOST_CLBL_TRTS_CC U::*)(Args...)
135 
136  template<typename NewReturn>
137  using apply_return =
138  NewReturn(BOOST_CLBL_TRTS_CC T::*)(Args...)
142 
143  template<template<class...> class Container>
144  using expand_args = Container<invoke_type, Args...>;
145 
146  using is_member_pointer = std::true_type;
147 };
#define BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER
Definition: config.hpp:37
#define BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER
Definition: config.hpp:106
#define BOOST_CLBL_TRTS_CC_TAG
Definition: function.hpp:81
#define BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS
Definition: function.hpp:72
#define BOOST_CLBL_TRTS_CC
Definition: function.hpp:83
#define BOOST_CLBL_TRTS_VARARGS_CC
Definition: function.hpp:82
#define BOOST_CLBL_TRTS_IS_NOEXCEPT
Definition: function_2.hpp:12
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
Definition: function_2.hpp:11
constexpr qualifier_flags volatile_
constexpr qualifier_flags rref_
constexpr qualifier_flags const_
constexpr qualifier_flags cv_
std::integral_constant< qualifier_flags, Flags &~const_ > remove_const_flag
constexpr qualifier_flags lref_
std::integral_constant< qualifier_flags, !AlreadyHasRef ?(Existing|Other) :(AlreadyHasLRef ?(Existing|(Other &~rref_)) :(IsAddingLRef ?((Existing &~rref_)|Other) :(Existing|Other)))> collapse_flags
std::integral_constant< qualifier_flags, Flags &~volatile_ > remove_volatile_flag
typename set_member_function_qualifiers_t< Flags, IsTransactionSafe, IsNoexcept, Ts... >::type set_member_function_qualifiers
Definition: pmf.hpp:34
Return(BOOST_CLBL_TRTS_CC T::*)(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC type
Definition: pmf_4.hpp:48
Return(BOOST_CLBL_TRTS_CC T::*)(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER add_noexcept
Definition: pmf_4.hpp:85
Return(BOOST_CLBL_TRTS_CC T::*)(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER BOOST_CLBL_TRTS_NOEXCEPT_SPEC add_transaction_safe
Definition: pmf_4.hpp:96
Return(BOOST_CLBL_TRTS_CC T::*)(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_NOEXCEPT_SPEC remove_transaction_safe
Definition: pmf_4.hpp:91
Return(Args...) BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC qualified_function_type
Definition: pmf_4.hpp:66
set_member_function_qualifiers< Flags, is_transaction_safe::value, is_noexcept::value, BOOST_CLBL_TRTS_CC_TAG, T, Return, Args... > set_qualifiers
Definition: pmf_4.hpp:105
Return(BOOST_CLBL_TRTS_CC U::*)(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC apply_member_pointer
Definition: pmf_4.hpp:134
Return(BOOST_CLBL_TRTS_CC T::*)(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE remove_noexcept
Definition: pmf_4.hpp:80
typename std::conditional< std::is_rvalue_reference< T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS >::value, T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS, typename std::add_lvalue_reference< T BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS >::type >::type invoke_type
Definition: pmf_4.hpp:54
Return(BOOST_CLBL_TRTS_VARARGS_CC T::*)(Args...,...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC add_varargs
Definition: pmf_4.hpp:74
NewReturn(BOOST_CLBL_TRTS_CC T::*)(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC apply_return
Definition: pmf_4.hpp:141
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
Definition: function.hpp:11
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
Definition: function.hpp:12
#define BOOST_CLBL_TRTS_INCLUDE_ABOMINABLE_QUALIFIERS
Definition: pmf.hpp:89