Blaze 3.9
Unique.h
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_UTIL_TYPELIST_UNIQUE_H_
36#define _BLAZE_UTIL_TYPELIST_UNIQUE_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
46
47
48namespace blaze {
49
50//=================================================================================================
51//
52// CLASS DEFINITION
53//
54//=================================================================================================
55
56//*************************************************************************************************
72template< typename TL > // Type of the type list
73struct Unique;
74//*************************************************************************************************
75
76
77//*************************************************************************************************
82template<>
83struct Unique< TypeList<> >
84{
85 using Type = TypeList<>;
86};
88//*************************************************************************************************
89
90
91//*************************************************************************************************
96template< typename T // Type of the head of the type list
97 , typename... Ts > // Types of the tail of the type list
98struct Unique< TypeList<T,Ts...> >
99{
100 private:
101 using TL1 = typename Unique< TypeList<Ts...> >::Type;
102 using TL2 = typename Erase<TL1,T>::Type;
103
104 public:
105 using Type = typename Append< TypeList<T>, TL2 >::Type;
106};
108//*************************************************************************************************
109
110
111//*************************************************************************************************
124template< typename TL > // Type of the type list
125using Unique_t = typename Unique<TL>::Type;
126//*************************************************************************************************
127
128} // namespace blaze
129
130#endif
Header file for the Append class template.
Header file for the Erase class template.
typename Unique< TL >::Type Unique_t
Auxiliary alias declaration for the Unique class template.
Definition: Unique.h:125
Appending a type to a type list.
Definition: Append.h:69
Erasing the first occurrence of a type from a type list.
Definition: Erase.h:74
Implementation of a type list.
Definition: TypeList.h:120
Erasing all duplicates from a type list.
Definition: Unique.h:73
Header file for the TypeList class template.