ttg 1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
function_3.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2016 Barrett Adair
3
4Distributed 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
7HEADER GUARDS INTENTIONALLY OMITTED
8DO NOT INCLUDE THIS HEADER DIRECTLY
9
10macros used:
11
12BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS - the function-level qualifiers for the
13 current inclusion (combinations of `const` `volatile` `&` `&&`, or nothing)
14
15BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE - the transaction_safe specifier for
16 the current include (`transaction_safe` or nothing)
17
18BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE - `std::true_type` or `std::false_type`,
19 tied on whether BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE is `transaction_safe`
20
21BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER - `transaction_safe` when
22 BOOST_CLBL_TRTS_ENABLE_TRANSACTION_SAFE is enabled, otherwise nothing
23
24BOOST_CLBL_TRTS_NOEXCEPT_SPEC - the noexcept specifier for
25 the current include (`noexcept` or nothing)
26
27BOOST_CLBL_TRTS_IS_NOEXCEPT - `std::true_type` or `std::false_type`,
28 tied on whether BOOST_CLBL_TRTS_NOEXCEPT_SPEC is `noexcept`
29
30BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER - `noexcept` if
31 BOOST_CLBL_TRTS_ENABLE_NOEXCEPT_TYPES is defined, otherwise nothing
32
33*/
34
35template<typename Return, typename... Args>
36struct function<Return(Args...)
40 : default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS> {
41
42 static constexpr bool value = true;
43
44 using traits = function;
45
46 using return_type = Return;
47
48 using arg_types = std::tuple<Args...>;
50
51 using type = Return(Args...)
55
56 using function_type = Return(Args...);
57
58 using qualified_function_type = Return(Args...)
62
64
65 using add_varargs = Return (Args..., ...)
69
71
72 using remove_noexcept = Return(Args...)
75
76 using add_noexcept = Return(Args...)
80
82
83 using remove_transaction_safe = Return(Args...)
86
87 using add_transaction_safe = Return(Args...)
91
92 using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;
93
94 template<qualifier_flags Flags>
95 using set_qualifiers = set_function_qualifiers<Flags, is_transaction_safe::value,
96 is_noexcept::value, Return, Args...>;
97
98 #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
99
100 using add_member_lvalue_reference = abominable_functions_not_supported_on_this_compiler;
101 using add_member_rvalue_reference = abominable_functions_not_supported_on_this_compiler;
102 using add_member_const = abominable_functions_not_supported_on_this_compiler;
103 using add_member_volatile = abominable_functions_not_supported_on_this_compiler;
104 using add_member_cv = abominable_functions_not_supported_on_this_compiler;
105
106 #else
107
109 collapse_flags<qualifiers::q_flags, lref_>::value>;
110
112 collapse_flags<qualifiers::q_flags, rref_>::value>;
113
115
117
119
120 #endif // #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
121
123
125 qualifiers::ref_flags | remove_const_flag<qualifiers::cv_flags>::value>;
126
128 qualifiers::ref_flags | remove_volatile_flag<qualifiers::cv_flags>::value>;
129
131
132 template<typename U>
133 using apply_member_pointer = add_member_pointer<type, U>;
134
135 template<typename NewReturn>
136 using apply_return = NewReturn(Args...)
140
141 template<template<class...> class Container>
142 using expand_args = Container<Args...>;
143
144 using is_member_pointer = std::false_type;
145};
146
147
148template<typename Return, typename... Args>
149struct function<Return (Args..., ...)
153 : default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS> {
154
155 static constexpr bool value = true;
156
157 using has_varargs = std::true_type;
158 using traits = function;
159 using return_type = Return;
160 using arg_types = std::tuple<Args...>;
161
162 using type = Return (Args..., ...)
166
167 using function_type = Return(Args..., ...);
168
169 using qualified_function_type = Return(Args..., ...)
173
174 using remove_varargs = Return (Args...)
178
180
182
183 using remove_noexcept = Return(Args..., ...)
186
187 using add_noexcept = Return(Args..., ...)
191
193
194 using remove_transaction_safe = Return(Args..., ...)
197
198 using add_transaction_safe = Return(Args..., ...)
202
203 using qualifiers = default_callable_traits<dummy BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS>;
204
205 template<qualifier_flags Flags>
206 using set_qualifiers = set_varargs_function_qualifiers<Flags, is_transaction_safe::value,
207 is_noexcept::value, Return, Args...>;
208
209 #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
210
211 using add_member_lvalue_reference = abominable_functions_not_supported_on_this_compiler;
212 using add_member_rvalue_reference = abominable_functions_not_supported_on_this_compiler;
213 using add_member_const = abominable_functions_not_supported_on_this_compiler;
214 using add_member_volatile = abominable_functions_not_supported_on_this_compiler;
215 using add_member_cv = abominable_functions_not_supported_on_this_compiler;
216
217 #else
218
220 collapse_flags<qualifiers::q_flags, lref_>::value>;
221
223 collapse_flags<qualifiers::q_flags, rref_>::value>;
224
226
228
230
231 #endif // #ifdef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
232
234
236 qualifiers::ref_flags | remove_const_flag<qualifiers::cv_flags>::value>;
237
239 qualifiers::ref_flags | remove_volatile_flag<qualifiers::cv_flags>::value>;
240
242
243 template<typename U>
245 Return( BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC U::*)(Args..., ...)
249
250 template<typename NewReturn>
251 using apply_return = NewReturn(Args..., ...)
255
256 template<template<class...> class Container>
257 using expand_args = Container<Args...>;
258
259 using is_member_pointer = std::false_type;
260};
#define BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC
Definition config.hpp:87
#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_INCLUDE_QUALIFIERS
Definition function.hpp:24
#define BOOST_CLBL_TRTS_IS_NOEXCEPT
#define BOOST_CLBL_TRTS_NOEXCEPT_SPEC
STL namespace.
Return(Args...,...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE remove_noexcept
set_varargs_function_qualifiers< Flags, is_transaction_safe::value, is_noexcept::value, Return, Args... > set_qualifiers
Return(Args...,...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER BOOST_CLBL_TRTS_NOEXCEPT_SPEC add_transaction_safe
Return(BOOST_CLBL_TRTS_DEFAULT_VARARGS_CC U::*)(Args...,...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC apply_member_pointer
set_qualifiers< qualifiers::ref_flags|remove_volatile_flag< qualifiers::cv_flags >::value > remove_member_volatile
Return(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC remove_varargs
Return(Args...,...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER add_noexcept
set_qualifiers< qualifiers::ref_flags|remove_const_flag< qualifiers::cv_flags >::value > remove_member_const
Return(Args...,...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC qualified_function_type
Return(Args...,...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC type
NewReturn(Args...,...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC apply_return
Return(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPECIFIER add_noexcept
Return(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC qualified_function_type
Return(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE remove_noexcept
Return(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_TRANSACTION_SAFE_SPECIFIER BOOST_CLBL_TRTS_NOEXCEPT_SPEC add_transaction_safe
NewReturn(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC apply_return
set_qualifiers< qualifiers::ref_flags|remove_volatile_flag< qualifiers::cv_flags >::value > remove_member_volatile
set_qualifiers< qualifiers::ref_flags|remove_const_flag< qualifiers::cv_flags >::value > remove_member_const
Return(Args...,...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC add_varargs
set_function_qualifiers< Flags, is_transaction_safe::value, is_noexcept::value, Return, Args... > set_qualifiers
Return(Args...) BOOST_CLBL_TRTS_INCLUDE_QUALIFIERS BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE BOOST_CLBL_TRTS_NOEXCEPT_SPEC type
#define BOOST_CLBL_TRTS_INCLUDE_TRANSACTION_SAFE
Definition function.hpp:11
#define BOOST_CLBL_TRTS_IS_TRANSACTION_SAFE
Definition function.hpp:12