Lists of types which may be used in some of the ugmisc templates where a single type would usually be used. More...
#include <type_traits>Go to the source code of this file.
Classes | |
| struct | ugmisc::flatten< T > |
| Converts the template parameters into a type_list. More... | |
Typedefs | |
| template<std::size_t I, class T> | |
| using | ugmisc::get_indexed_t = typename get_indexed<I, T>::type |
| template<class... T> | |
| using | ugmisc::concatenate_type_lists_t = typename concatenate_type_lists<T...>::type |
| template<class T> | |
| using | ugmisc::get_as_list_t = typename get_as_list<T>::type |
| template<class... T> | |
| using | ugmisc::flatten_t = typename flatten<T...>::type |
Lists of types which may be used in some of the ugmisc templates where a single type would usually be used.
The UGMISC_NAMED_MEMBER_TYPE_TEST macro declares a template that can be instanciated with a type and an optional default type, for example:
These declarations allow types to be tested for member types called 'Foo'.
In the above example, you could also pass a series of types which may or may not have a member type called Foo, like this:
If member type A::Foo exists, that will be the type aliased by FooType. Otherwise, B::Foo will be used, or failing that C::Foo, or as a last resort, int.
If you really want to use a type_list type as the type to check for a member, you can wrap it:
Templates which use type_lists in this way rely on the template #flatten_t.
| using ugmisc::concatenate_type_lists_t = typename concatenate_type_lists<T...>::type |
Aliases a type which is a type_list containing all the member types of the template paramter type_list types.
For example:
| T | Each type is an instance of type_list. |