3#ifndef DUNE_COMMON_TYPELIST_HH
4#define DUNE_COMMON_TYPELIST_HH
10#include <dune/common/std/type_traits.hh>
126 struct TypeListSize {};
137 struct TypeListSize<
TypeList<T...>> : std::integral_constant<std::size_t, sizeof...(T)> {};
141 template<std::
size_t i,
class T>
142 struct TypeListElement {};
149 template<std::size_t i,
class... T>
157 using type =
typename std::tuple_element<i, std::tuple<T...>>::type;
170 template<std::
size_t i,
class T>
175 template<
template<
class...>
class Target,
class ToDoList,
class... Processed>
176 struct UniqueTypesHelper;
178 template<
template<
class...>
class Target,
class... Processed>
179 struct UniqueTypesHelper<Target,
TypeList<>, Processed...>
181 using type = Target<Processed...>;
184 template<
template<
class...>
class Target,
class T0,
class... T,
class... Processed>
185 struct UniqueTypesHelper<Target,
TypeList<T0, T...>, Processed...>
187 using type = std::conditional_t<
189 typename UniqueTypesHelper<Target,
TypeList<T...>, Processed...>::type,
190 typename UniqueTypesHelper<Target,
TypeList<T...>, T0, Processed...>::type>;
194 template<
template<
class...>
class Target,
class TL>
195 struct UnpackTypeList;
197 template<
template<
class...>
class Target,
class... T>
200 using type = Target<T...>;
209 template<
template<
class...>
class Target,
class TL>
219 template<
template<
class...>
class Target,
class... T>
227 template<
class NonUniqueTypeList>
228 using UniqueTypeList_t =
typename Impl::UniqueTypesHelper<TypeList, NonUniqueTypeList>::type;
std::tuple< MetaType< T >... > TypeList
A simple type list.
Definition: typelist.hh:87
Dune namespace.
Definition: alignedallocator.hh:14
typename Impl::UnpackTypeList< Target, TL >::type UnpackTypeList_t
Unpack Dune::TypeList.
Definition: typelist.hh:210
constexpr auto uniqueTypeList(TypeList< T... > list)
Remove duplicates from a Dune::TypeList.
Definition: typelist.hh:236
typename Impl::UniqueTypesHelper< Target, TypeList< T... > >::type UniqueTypes_t
Remove duplicates from a list of types.
Definition: typelist.hh:220
typename Impl::UniqueTypesHelper< TypeList, NonUniqueTypeList >::type UniqueTypeList_t
Remove duplicates from a Dune::TypeList.
Definition: typelist.hh:228
typename TypeListElement< i, T >::type TypeListEntry_t
Shortcut for TypeListElement<i, T>::type;.
Definition: typelist.hh:171
Check if given type is an empty TypeList.
Definition: typelist.hh:121
Check if given type is a TypeList.
Definition: typelist.hh:100
forms the logical disjunction of the type traits B...
Definition: type_traits.hh:475
typename std::tuple_element< i, std::tuple< T... > >::type type
Export type of i-th element in TypeList.
Definition: typelist.hh:157
type Type
Export type of i-th element in TypeList.
Definition: typelist.hh:164