48 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
50 _GLIBCXX_BEGIN_NAMESPACE_VERSION
59 template<
typename Root>
66 template<
typename Hd,
typename Typelist>
70 typedef Typelist tail;
74 template<
typename Fn,
typename Typelist>
79 template<
typename Gn,
typename Typelist>
84 template<
typename Gn,
typename TypelistT,
typename TypelistV>
88 template<
typename Typelist0,
typename Typelist1>
91 template<
typename Typelist_Typelist>
92 struct append_typelist;
94 template<
typename Typelist,
typename T>
97 template<
typename Typelist,
template<
typename T>
class Pred>
100 template<
typename Typelist,
int i>
103 template<
typename Typelist,
template<
typename T>
class Transform>
106 template<
typename Typelist_Typelist>
109 template<
typename Typelist>
112 template<
typename T1>
115 template<
typename T1,
typename T2>
118 template<
typename T1,
typename T2,
typename T3>
121 template<
typename T1,
typename T2,
typename T3,
typename T4>
124 template<
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
127 template<
typename T1,
typename T2,
typename T3,
128 typename T4,
typename T5,
typename T6>
132 _GLIBCXX_END_NAMESPACE_VERSION
136 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
138 _GLIBCXX_BEGIN_NAMESPACE_VERSION
144 template<
typename Fn,
typename Typelist_Chain>
147 template<
typename Fn,
typename Hd,
typename Tl>
148 struct apply_<Fn, chain<Hd, Tl> >
159 template<
typename Fn>
160 struct apply_<Fn, null_type>
166 template<
typename Gn,
typename Typelist_Chain>
167 struct apply_generator1_;
169 template<
typename Gn,
typename Hd,
typename Tl>
170 struct apply_generator1_<Gn, chain<Hd, Tl> >
175 g.template operator()<Hd>();
176 apply_generator1_<Gn, Tl> next;
181 template<
typename Gn>
182 struct apply_generator1_<Gn, null_type>
188 template<
typename Gn,
typename TypelistT_Chain,
typename TypelistV_Chain>
189 struct apply_generator2_;
191 template<
typename Gn,
typename Hd1,
typename TlT,
typename Hd2,
typename TlV>
192 struct apply_generator2_<Gn, chain<Hd1, TlT>, chain<Hd2, TlV> >
197 g.template operator()<Hd1, Hd2>();
198 apply_generator2_<Gn, TlT, TlV> next;
203 template<
typename Gn>
204 struct apply_generator2_<Gn, null_type, null_type>
210 template<
typename Typelist_Chain0,
typename Typelist_Chain1>
213 template<
typename Hd,
typename Tl,
typename Typelist_Chain>
214 struct append_<chain<Hd, Tl>, Typelist_Chain>
217 typedef append_<Tl, Typelist_Chain> append_type;
220 typedef chain<Hd, typename append_type::type> type;
223 template<
typename Typelist_Chain>
224 struct append_<null_type, Typelist_Chain>
226 typedef Typelist_Chain type;
229 template<
typename Typelist_Chain>
230 struct append_<Typelist_Chain, null_type>
232 typedef Typelist_Chain type;
236 struct append_<null_type, null_type>
238 typedef null_type type;
241 template<
typename Typelist_Typelist_Chain>
242 struct append_typelist_;
244 template<
typename Hd>
245 struct append_typelist_<chain<Hd, null_type> >
247 typedef chain<Hd, null_type> type;
250 template<
typename Hd,
typename Tl>
251 struct append_typelist_<chain< Hd, Tl> >
254 typedef typename append_typelist_<Tl>::type rest_type;
257 typedef typename append<Hd, node<rest_type> >::type::root type;
260 template<
typename Typelist_Chain,
typename T>
264 struct contains_<null_type, T>
272 template<
typename Hd,
typename Tl,
typename T>
273 struct contains_<chain<Hd, Tl>, T>
277 value = contains_<Tl, T>::value
281 template<
typename Tl,
typename T>
282 struct contains_<chain<T, Tl>, T>
290 template<
typename Typelist_Chain,
template<
typename T>
class Pred>
291 struct chain_filter_;
293 template<
template<
typename T>
class Pred>
294 struct chain_filter_<null_type, Pred>
296 typedef null_type type;
299 template<
typename Hd,
typename Tl,
template<
typename T>
class Pred>
300 struct chain_filter_<chain<Hd, Tl>, Pred>
305 include_hd = Pred<Hd>::value
308 typedef typename chain_filter_<Tl, Pred>::type rest_type;
309 typedef chain<Hd, rest_type> chain_type;
312 typedef typename __conditional_type<include_hd, chain_type, rest_type>::__type type;
315 template<
typename Typelist_Chain,
int i>
316 struct chain_at_index_;
318 template<
typename Hd,
typename Tl>
319 struct chain_at_index_<chain<Hd, Tl>, 0>
324 template<
typename Hd,
typename Tl,
int i>
325 struct chain_at_index_<chain<Hd, Tl>, i>
327 typedef typename chain_at_index_<Tl, i - 1>::type type;
330 template<
class Typelist_Chain,
template<
typename T>
class Transform>
331 struct chain_transform_;
333 template<
template<
typename T>
class Transform>
334 struct chain_transform_<null_type, Transform>
336 typedef null_type type;
339 template<
class Hd,
class Tl,
template<
typename T>
class Transform>
340 struct chain_transform_<chain<Hd, Tl>, Transform>
343 typedef typename chain_transform_<Tl, Transform>::type rest_type;
344 typedef typename Transform<Hd>::type transform_type;
347 typedef chain<transform_type, rest_type> type;
350 template<
typename Typelist_Typelist_Chain>
351 struct chain_flatten_;
353 template<
typename Hd_Tl>
354 struct chain_flatten_<chain<Hd_Tl, null_type> >
356 typedef typename Hd_Tl::root type;
359 template<
typename Hd_Typelist,
class Tl_Typelist>
360 struct chain_flatten_<chain<Hd_Typelist, Tl_Typelist> >
363 typedef typename chain_flatten_<Tl_Typelist>::type rest_type;
364 typedef append<Hd_Typelist, node<rest_type> > append_type;
366 typedef typename append_type::type::root type;
371 _GLIBCXX_END_NAMESPACE_VERSION
374 #define _GLIBCXX_TYPELIST_CHAIN1(X0) __gnu_cxx::typelist::chain<X0, __gnu_cxx::typelist::null_type> 375 #define _GLIBCXX_TYPELIST_CHAIN2(X0, X1) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN1(X1) > 376 #define _GLIBCXX_TYPELIST_CHAIN3(X0, X1, X2) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN2(X1, X2) > 377 #define _GLIBCXX_TYPELIST_CHAIN4(X0, X1, X2, X3) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN3(X1, X2, X3) > 378 #define _GLIBCXX_TYPELIST_CHAIN5(X0, X1, X2, X3, X4) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN4(X1, X2, X3, X4) > 379 #define _GLIBCXX_TYPELIST_CHAIN6(X0, X1, X2, X3, X4, X5) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN5(X1, X2, X3, X4, X5) > 380 #define _GLIBCXX_TYPELIST_CHAIN7(X0, X1, X2, X3, X4, X5, X6) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN6(X1, X2, X3, X4, X5, X6) > 381 #define _GLIBCXX_TYPELIST_CHAIN8(X0, X1, X2, X3, X4, X5, X6, X7) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN7(X1, X2, X3, X4, X5, X6, X7) > 382 #define _GLIBCXX_TYPELIST_CHAIN9(X0, X1, X2, X3, X4, X5, X6, X7, X8) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN8(X1, X2, X3, X4, X5, X6, X7, X8) > 383 #define _GLIBCXX_TYPELIST_CHAIN10(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN9(X1, X2, X3, X4, X5, X6, X7, X8, X9) > 384 #define _GLIBCXX_TYPELIST_CHAIN11(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN10(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10) > 385 #define _GLIBCXX_TYPELIST_CHAIN12(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN11(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11) > 386 #define _GLIBCXX_TYPELIST_CHAIN13(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN12(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12) > 387 #define _GLIBCXX_TYPELIST_CHAIN14(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN13(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13) > 388 #define _GLIBCXX_TYPELIST_CHAIN15(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN14(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14) > 389 #define _GLIBCXX_TYPELIST_CHAIN16(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN15(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15) > 390 #define _GLIBCXX_TYPELIST_CHAIN17(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN16(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16) > 391 #define _GLIBCXX_TYPELIST_CHAIN18(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN17(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17) > 392 #define _GLIBCXX_TYPELIST_CHAIN19(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN18(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18) > 393 #define _GLIBCXX_TYPELIST_CHAIN20(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18, X19) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN19(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18, X19) > 395 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
397 _GLIBCXX_BEGIN_NAMESPACE_VERSION
401 template<
typename Fn,
typename Typelist>
403 apply(Fn& fn, Typelist)
405 detail::apply_<Fn, typename Typelist::root> a;
409 template<
typename Fn,
typename Typelist>
413 detail::apply_generator1_<Fn, typename Typelist::root> a;
417 template<
typename Fn,
typename TypelistT,
typename TypelistV>
421 typedef typename TypelistT::root rootT;
422 typedef typename TypelistV::root rootV;
423 detail::apply_generator2_<Fn, rootT, rootV> a;
427 template<
typename Typelist0,
typename Typelist1>
431 typedef typename Typelist0::root root0_type;
432 typedef typename Typelist1::root root1_type;
433 typedef detail::append_<root0_type, root1_type> append_type;
436 typedef node<typename append_type::type> type;
439 template<
typename Typelist_Typelist>
440 struct append_typelist
443 typedef typename Typelist_Typelist::root root_type;
444 typedef detail::append_typelist_<root_type> append_type;
447 typedef node<typename append_type::type> type;
450 template<
typename Typelist,
typename T>
454 typedef typename Typelist::root root_type;
459 value = detail::contains_<root_type, T>::value
463 template<
typename Typelist,
template<
typename T>
class Pred>
467 typedef typename Typelist::root root_type;
468 typedef detail::chain_filter_<root_type, Pred> filter_type;
471 typedef node<typename filter_type::type> type;
474 template<
typename Typelist,
int i>
478 typedef typename Typelist::root root_type;
479 typedef detail::chain_at_index_<root_type, i> index_type;
482 typedef typename index_type::type type;
485 template<
typename Typelist,
template<
typename T>
class Transform>
489 typedef typename Typelist::root root_type;
490 typedef detail::chain_transform_<root_type, Transform> transform_type;
493 typedef node<typename transform_type::type> type;
496 template<
typename Typelist_Typelist>
500 typedef typename Typelist_Typelist::root root_type;
501 typedef typename detail::chain_flatten_<root_type>::type flatten_type;
504 typedef node<flatten_type> type;
507 template<
typename Typelist>
511 typedef typename at_index<Typelist, 0>::type first_type;
514 typedef node<chain<first_type, null_type> > type;
517 template<
typename T1>
520 typedef node<_GLIBCXX_TYPELIST_CHAIN1(T1)> type;
523 template<
typename T1,
typename T2>
526 typedef node<_GLIBCXX_TYPELIST_CHAIN2(T1,T2)> type;
529 template<
typename T1,
typename T2,
typename T3>
532 typedef node<_GLIBCXX_TYPELIST_CHAIN3(T1,T2,T3)> type;
535 template<
typename T1,
typename T2,
typename T3,
typename T4>
538 typedef node<_GLIBCXX_TYPELIST_CHAIN4(T1,T2,T3,T4)> type;
541 template<
typename T1,
typename T2,
typename T3,
542 typename T4,
typename T5>
545 typedef node<_GLIBCXX_TYPELIST_CHAIN5(T1,T2,T3,T4,T5)> type;
548 template<
typename T1,
typename T2,
typename T3,
549 typename T4,
typename T5,
typename T6>
552 typedef node<_GLIBCXX_TYPELIST_CHAIN6(T1,T2,T3,T4,T5,T6)> type;
555 _GLIBCXX_END_NAMESPACE_VERSION
void apply_generator(Gn &, Typelist)
Apply all typelist types to generator functor.
GNU extensions for public use.