Dune Core Modules (2.6.0)
Type traits, overload helpers, and other utilities for type computations. More...
Classes | |
struct | Dune::MetaType< T > |
A type that refers to another type. More... | |
struct | Dune::IsTypeList< T > |
Check if given type is a TypeList. More... | |
struct | Dune::IsTypeList< TypeList< T... > > |
Check if given type is a TypeList. More... | |
struct | Dune::IsEmptyTypeList< T > |
Check if given type is an empty TypeList. More... | |
struct | Dune::TypeListSize< TypeList< T... > > |
Get size of TypeList. More... | |
struct | Dune::TypeListElement< i, TypeList< T... > > |
Get element of TypeList. More... | |
struct | Dune::PriorityTag< priority > |
Helper class for tagging priorities. More... | |
struct | Dune::PriorityTag< 0 > |
Helper class for tagging priorities. More... | |
Typedefs | |
template<class... T> | |
using | Dune::TypeList = std::tuple< MetaType< T >... > |
A simple type list. More... | |
template<class This , class... T> | |
using | Dune::disableCopyMove = std::enable_if_t< not Impl::disableCopyMoveHelper< This, T... >::value, int > |
Helper to disable constructor as copy and move constructor. More... | |
Detailed Description
Type traits, overload helpers, and other utilities for type computations.
Typedef Documentation
◆ disableCopyMove
using Dune::disableCopyMove = typedef std::enable_if_t< not Impl::disableCopyMoveHelper<This, T...>::value, int> |
Helper to disable constructor as copy and move constructor.
Helper typedef to remove constructor with forwarding reference from overload set for copy and move constructor or assignment.
◆ TypeList
using Dune::TypeList = typedef std::tuple<MetaType<T>...> |
A simple type list.
The purpose of this is to encapsulate a list of types. This allows, e.g., to pack an argument-pack into one type. In contrast to a std::tuple a TypeList can be created without creating any object of the stored types.
This can, e.g., be used for overload resolution with tag-dispatch where TypeList is used as tag. In combination with PriorityTag this allows to emulate partial specialization of function templates in a sane way, i.e., without the hassle of classic specialization of function templates
A TypeList<T...>
can be iterated over using Hybrid::forEach()
. For the purpose of iterating with Hybrid::forEach()
, the members of TypeList<T...>{}
are MetaType<T>{}...
. This allows iteration over incomplete and non-constructible types, since no attempt is made to create objects of those types:
It is also possible to iterate over complete-but-non-instantiable types, e.g. tuple<void>
. But to do so you need to suppress ADL in the invocation of forEach()
, since ADL would try to instanciate complete types in the template argument list of TypeList
in order to find the associated namespaces. To suppress ADL you can either use a qualified lookup:
or you can enclose the name forEach
in parentheses: