DUNE-ACFEM (unstable)

uniquetags.hh
1#ifndef __DUNE_ACFEM_MPL_UNIQUETAGS_HH__
2#define __DUNE_ACFEM_MPL_UNIQUETAGS_HH__
3
4#include "typetuple.hh"
5
6namespace Dune::ACFem::MPL {
7
8 template<class... Tags>
9 struct TagContainer
10 : TypeTuple<Tags...>
11 , Tags...
12 {
13 using TagTuple = TagContainer;
14 };
15
16 template<class Input, class Output>
17 struct RemoveImpliedType;
18
19 template<class... In0, class... In, class... Out>
20 struct RemoveImpliedType<TypeTuple<TagContainer<In0...>, In...>, TypeTuple<Out...> >
21 : RemoveImpliedType<TypeTuple<In0..., In...>, TypeTuple<Out...> >
22 {};
23
24 template<class In0, class... In, class... Out>
25 struct RemoveImpliedType<TypeTuple<In0, In...>, TypeTuple<Out...> >
26 : RemoveImpliedType<TypeTuple<In...>, ConditionalType<(std::is_same<In0, void>::value
27 || (... || (std::is_base_of<In0, Out>::value))
28 || (... || (std::is_base_of<In0, In>::value))
29 ),
30 TypeTuple<Out...>,
31 TypeTuple<Out..., In0> > >
32 {};
33
34 template<class... Out>
35 struct RemoveImpliedType<TypeTuple<>, TypeTuple<Out...> >
36 {
37 using Type = TypeTuple<Out...>;
38 };
39
41 template<class... Tags>
42 using RemoveImplied = typename RemoveImpliedType<TypeTuple<Tags...>, TypeTuple<> >::Type;
43
44 template<class Tuple>
45 struct MakeTagContainer;
46
47 template<class... Tags>
48 struct MakeTagContainer<TypeTuple<Tags...> >
49 {
50 using Type = TagContainer<Tags...>;
51 };
52
53 template<class... Tags>
54 using UniqueTags = typename MakeTagContainer<RemoveImplied<Tags...> >::Type;
55
56}
57
58#endif // __DUNE_ACFEM_MPL_UNIQUETAGS_HH__
Form a sub-sequence with the values at the positions NOT given in Indices.
Definition: conditional.hh:8
typename RemoveImpliedType< TypeTuple< Tags... >, TypeTuple<> >::Type RemoveImplied
Remove types which are base classes of other types in the list.
Definition: uniquetags.hh:42
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Jun 19, 23:17, 2026)