ttg 1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
default_callable_traits.hpp
Go to the documentation of this file.
1/*
2Copyright Barrett Adair 2016-2017
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
7*/
8
9#ifndef BOOST_CLBL_TRTS_DETAIL_DEFAULT_BOOST_CLBL_TRTS_HPP
10#define BOOST_CLBL_TRTS_DETAIL_DEFAULT_BOOST_CLBL_TRTS_HPP
11
12namespace boost { namespace callable_traits { namespace detail {
13
14template<typename T = void>
16
17 // value is used by all traits classes to participate
18 // in the <callable_traits/detail/traits.hpp> disjunction.
19 static constexpr bool value = false;
20
21 // used facilitate the disjunction in
22 // <callable_traits/detail/traits.hpp>
24
26
27 // represents the type under consideration
28 using type = error_t;
29
30 // std::true_type for callables with C-style variadics
31 using has_varargs = std::false_type;
32
34
35 // arg_types is a std::tuple of argument types for
36 // callables that are not overloaded/templated function objects.
37 // arg_types IS defined in terms of INVOKE, which means
38 // a PMF's arg_types tuple will use a reference to its
39 // parent class as the first argument, with qualifiers added to
40 // match the PMF's own qualifiers.
42
43 // arg_types without the decltype(*this) parameter for member functions
45
46 // An "approximation" of a callable type, in the form
47 // of a plain function type. Defined in terms of INVOKE.
48 // An identity alias for qualified/unqualified plain function
49 // types.
51
52 // Used to smoothen the edges between PMFs and function objects
54
55 // An identity alias for qualified/unqualified plain function
56 // types. Equivalent to remove_member_pointer for PMFs. Same
57 // as function_type for other callable types.
59
60 // Removes C-style variadics from a signature, if present.
61 // Aliases error_t for function objects and PMDs.
63
64 // Adds C-style variadics to a signature. Aliases
65 // error_t for function objects and PMDs.
67
68 // std::true_type when the signature includes noexcept, when
69 // the feature is available
70 using is_noexcept = std::false_type;
71
72 // adds noexcept to a signature if the feature is available
74
75 // removes noexcept from a signature if present
77
78 // std::true_type when the signature includes transaction_safe, when
79 // the feature is available
80 using is_transaction_safe = std::false_type;
81
82 // adds transaction_safe to a signature if the feature is available
84
85 // removes transaction_safe from a signature if present
87
88 // The class of a PMD or PMF. error_t for other types
90
91 // The qualified reference type of class_type. error_t
92 // for non-member-pointers.
94
95 // Removes reference qualifiers from a signature.
97
98 // Adds an lvalue qualifier to a signature, in arbitrary
99 // accordance with C++11 reference collapsing rules.
101
102 // Adds an rvalue qualifier to a signature, in arbitrary
103 // accordance with C++11 reference collapsing rules.
105
106 // Adds a const qualifier to a signature.
108
109 // Adds a volatile qualifier to a signature.
111
112 // Adds both const and volatile qualifiers to a signature.
114
115 // Removes a const qualifier from a signature, if present.
117
118 // Removes a volatile qualifier from a signature, if present.
120
121 // Removes both const and volatile qualifiers from a
122 // signature, if any.
124
125 // Removes the member pointer from PMDs and PMFs. An identity
126 // alias for other callable types.
128
129 // Changes the parent class type for PMDs and PMFs. Turns
130 // function pointers, function references, and
131 // qualified/unqualified function types into PMFs. Turns
132 // everything else into member data pointers.
133 template<typename C,
134 typename U = T,
135 typename K = typename std::remove_reference<U>::type,
136 typename L = typename std::conditional<
137 std::is_same<void, K>::value, error_t, K>::type,
138 typename Class = typename std::conditional<
139 std::is_class<C>::value, C, error_t>::type>
140 using apply_member_pointer = typename std::conditional<
141 std::is_same<L, error_t>::value || std::is_same<Class, error_t>::value,
142 error_t, L Class::*>::type;
143
144 // Changes the return type of PMFs, function pointers, function
145 // references, and qualified/unqualified function types. Changes
146 // the data type of PMDs. error_t for function objects.
147 template<typename>
149
150 // Expands the argument types into a template
151 template<template<class...> class Container>
153
154 template<template<class...> class Container, typename... RightArgs>
156
157 template<template<class...> class Container, typename... LeftArgs>
159
161
162 template<typename... NewArgs>
164
165 template<typename... NewArgs>
167
168 template<std::size_t ElementCount>
170
171 template<std::size_t ElementCount>
173
174 template<std::size_t Index, typename... NewArgs>
176
177 template<std::size_t Index, std::size_t Count>
179
180 template<std::size_t Index, typename... NewArgs>
182
186
187 using has_member_qualifiers = std::integral_constant<bool, q_flags != default_>;
188 using is_const_member = std::integral_constant<bool, 0 < (cv_flags & const_)>;
189 using is_volatile_member = std::integral_constant<bool, 0 < (cv_flags & volatile_)>;
190 using is_cv_member = std::integral_constant<bool, cv_flags == (const_ | volatile_)>;
191
192#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
193 using is_reference_member = std::false_type;
194 using is_lvalue_reference_member = std::false_type;
195 using is_rvalue_reference_member = std::false_type;
196#else
197 using is_reference_member = std::integral_constant<bool, 0 < ref_flags>;
198 using is_lvalue_reference_member = std::integral_constant<bool, ref_flags == lref_>;
199 using is_rvalue_reference_member = std::integral_constant<bool, ref_flags == rref_>;
200#endif //#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
201
202};
203
204}}} // namespace boost::callable_traits::detail
205
206#endif // BOOST_CLBL_TRTS_DETAIL_DEFAULT_BOOST_CLBL_TRTS_HPP
207
constexpr qualifier_flags volatile_
typename std::conditional< std::is_reference< T >::value, reference_error, invalid_type >::type error_type
Definition utility.hpp:28
constexpr qualifier_flags const_
std::integral_constant< qualifier_flags,(std::is_const< T >::value ? const_ :default_)|(std::is_volatile< T >::value ? volatile_ :default_)> cv_of
std::integral_constant< qualifier_flags, std::is_rvalue_reference< T >::value ? rref_ :(std::is_lvalue_reference< T >::value ? lref_ :default_)> ref_of
std::integral_constant< bool, cv_flags==(const_|volatile_)> is_cv_member
std::integral_constant< bool, 0<(cv_flags &const_)> is_const_member
typename std::conditional< std::is_same< L, error_t >::value||std::is_same< Class, error_t >::value, error_t, L Class::* >::type apply_member_pointer
std::integral_constant< bool, ref_flags==rref_ > is_rvalue_reference_member
std::integral_constant< bool, 0< ref_flags > is_reference_member
std::integral_constant< bool, ref_flags==lref_ > is_lvalue_reference_member
std::integral_constant< bool, q_flags !=default_ > has_member_qualifiers
std::integral_constant< bool, 0<(cv_flags &volatile_)> is_volatile_member