13template<
typename ...>
struct pack;
21template<
typename ...Ts>
22struct pack_type : std::type_identity<pack<Ts...>> {};
26template<
typename T,
bool Filter>
struct filter_pack;
31struct filter_pack<T, true> : pack_type<T> {};
36struct filter_pack<T, false> : pack_type<> {};
41template<
typename ...Ts>
44 static constexpr auto size =
sizeof...(Ts);
49 template<
typename ...Us>
50 struct concat : pack_type<Ts..., Us...> {};
56 template<
typename ...Us>
61 template<
typename ...Us>
69 template<
template<
typename ...>
typename Trait,
typename ...Us>
70 struct any : std::integral_constant<bool,
71 (Trait<Ts, Us...>::value || ...)> {};
77 template<
template<
typename ...>
typename Trait,
typename ...Us>
78 static constexpr auto any_v =
any<Trait, Us...>::value;
85 template<
template<
typename ...>
typename Trait,
typename ...Us>
86 struct all : std::integral_constant<bool,
87 (Trait<Ts, Us...>::value && ...)> {};
93 template<
template<
typename ...>
typename Trait,
typename ...Us>
94 static constexpr auto all_v =
all<Trait, Us...>::value;
98 template<
template<
typename ...>
typename Tuple>
110 template<std::
size_t>
111 struct out_of_bounds : std::false_type {};
115 template<std::
size_t I>
117 static_assert(out_of_bounds<I>::value,
"pack index out of bounds");
123 template<
template<
typename ...>
typename,
typename ...>
124 struct map : detail::pack_type<> {};
129 template<
template<
typename ...>
typename Mod,
typename ...Ts>
130 using map_t =
typename map<Mod, Ts...>::type;
134 template<
template<
typename ...>
typename,
typename ...>
135 struct filter : detail::pack_type<> {};
140 template<
template<
typename ...>
typename Trait,
typename ...Ts>
141 using filter_t =
typename filter<Trait, Ts...>::type;
147template<
typename Head,
typename ...Tail>
158 template<std::
size_t I>
159 struct at : std::type_identity<
160 typename tail_t::template at<I - 1>::type> {};
165 struct at<0> : std::type_identity<Head> {};
169 template<std::
size_t I>
170 using at_t =
typename at<I>::type;
177 template<
template<
typename ...>
typename Mod,
typename ...Ts>
178 struct map : std::type_identity<
179 typename pack<typename Mod<Head, Ts...>::type>::template concat_t<
180 typename tail_t::template map<Mod, Ts...>::type>> {};
185 template<
template<
typename ...>
typename Mod,
typename ...Ts>
186 using map_t =
typename map<Mod, Ts...>::type;
193 template<
template<
typename ...>
typename Trait,
typename ...Ts>
194 struct filter : std::type_identity<
195 typename detail::filter_pack<Head, Trait<Head, Ts...>::value>::type
196 ::template concat_t<typename tail_t
197 ::template filter<Trait, Ts...>::type>> {};
203 template<
template<
typename ...>
typename Trait,
typename ...Ts>
204 using filter_t =
typename filter<Trait, Ts...>::type;
209template<
typename ...Ts>
Type Pack.
Definition typack.hpp:9
Provides a static constant which indicates whether all types in this pack match Trait
Definition typack.hpp:87
Provides a static constant which indicates whether any type in this pack matches Trait.
Definition typack.hpp:71
Provides a member typedef type which is this pack with Us added.
Definition typack.hpp:50
Provides common pack functionality.
Definition typack.hpp:42
typename concat< Us... >::type concat_t
Helper type which is this pack with Us added.
Definition typack.hpp:62
Tuple< Ts... > into_t
Helper type which wraps this pack's types in Tuple.
Definition typack.hpp:99
pack< Tail... > tail_t
Pack of all types in this pack, except for the first.
Definition typack.hpp:153
typename map< Mod, Ts... >::type map_t
Helper type which is all types in this pack transformed by Mod.
Definition typack.hpp:186
typename at< I >::type at_t
Helper type which is the type at pack index I.
Definition typack.hpp:170
Head head_t
First type in this pack.
Definition typack.hpp:150
typename filter< Trait, Ts... >::type filter_t
Helper type which is a pack with all types in this pack that match Trait.
Definition typack.hpp:204
Empty pack specialization.
Definition typack.hpp:106
typename map< Mod, Ts... >::type map_t
Helper type which transforms each type in this pack with Mod
Definition typack.hpp:130
typename filter< Trait, Ts... >::type filter_t
Helper type which filters the types in this pack matching Trait.
Definition typack.hpp:141
A wrapper for a type template parameter pack.
Definition typack.hpp:13