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::type_list_member |
| 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 |
| template<std::size_t From, std::size_t To, class T> | |
| using | ugmisc::type_list_slice = typename get_type_list_slice<From, To, T>::type |
| template<std::size_t From, std::size_t Count, class T> | |
| using | ugmisc::type_list_sized_slice = type_list_slice<From, From + Count, T> |
| template<std::size_t Count, class T> | |
| using | ugmisc::type_list_prefix = type_list_slice<0, Count, T> |
| template<std::size_t Count, class T> | |
| using | ugmisc::type_list_suffix = type_list_slice<T::size - Count, T::size, T> |
| template<std::size_t Count, class T> | |
| using | ugmisc::type_list_remove_prefix = type_list_slice<Count, T::size, T> |
| template<std::size_t Count, class T> | |
| using | ugmisc::type_list_remove_suffix = type_list_slice<0, T::size-Count, T> |
| template<std::size_t From, std::size_t To, class... T> | |
| using | ugmisc::flatten_slice = type_list_slice<From, To, flatten_t<T...>> |
| template<std::size_t From, std::size_t Count, class... T> | |
| using | ugmisc::flatten_sized_slice = type_list_sized_slice<From, Count, flatten_t<T...>> |
| template<std::size_t Count, class... T> | |
| using | ugmisc::flatten_prefix = type_list_prefix<Count, flatten_t<T...>> |
| template<std::size_t Count, class... T> | |
| using | ugmisc::flatten_suffix = type_list_suffix<Count, flatten_t<T...>> |
| template<std::size_t Count, class... T> | |
| using | ugmisc::flatten_remove_prefix = type_list_remove_prefix<Count, flatten_t<T...>> |
| template<std::size_t Count, class... T> | |
| using | ugmisc::flatten_remove_suffix = type_list_remove_suffix<Count, flatten_t<T...>> |
Lists of types which may be used in some of the ugmisc templates where a single type would usually be used.
The member.hpp header finds this stuff useful. You might too.
List of types can be manipulated easily, as if they are lists of objects.
Some operations are templates which come in two variants.
The flatten_ variants are more flexible, and will always work as a drop in replacement for their type_list_ twins. That might not be what you want though. If you think you have an instance of the type_list<> template to pass to e.g. flatten_filter then using type_list_filter is effectively like doing the same thing but also making a static assertion that it is indeed a type_list.
Operations include adding and removing prefixes and suffixes or taking slices from type_lists, filtering out some of the members of a type_list, and concatenating two or more type_lists.
| 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. |
| using ugmisc::flatten_prefix = type_list_prefix<Count, flatten_t<T...>> |
| using ugmisc::flatten_remove_prefix = type_list_remove_prefix<Count, flatten_t<T...>> |
Aliases an ugmisc::type_list with the first Count members of the parameter types T removed.
| using ugmisc::flatten_remove_suffix = type_list_remove_suffix<Count, flatten_t<T...>> |
Aliases an ugmisc::type_list with the last Count members of the template parameter types T removed.
| using ugmisc::flatten_sized_slice = type_list_sized_slice<From, Count, flatten_t<T...>> |
| using ugmisc::flatten_slice = type_list_slice<From, To, flatten_t<T...>> |
Creates an ugmisc::type_alias. Uses the From'th element of the list of types T, and all types up to but not including the To'th element.
| using ugmisc::flatten_suffix = type_list_suffix<Count, flatten_t<T...>> |
| using ugmisc::type_list_member |
| using ugmisc::type_list_prefix = type_list_slice<0, Count, T> |
Aliases an ugmisc::type_list with the first Count members of the type_list template parameter T.
| using ugmisc::type_list_remove_prefix = type_list_slice<Count, T::size, T> |
Aliases an ugmisc::type_list with the first Count members of the type_list template parameter T removed.
| using ugmisc::type_list_remove_suffix = type_list_slice<0, T::size-Count, T> |
Aliases an ugmisc::type_list with the last Count members of the type_list template parameter T removed.
| using ugmisc::type_list_sized_slice = type_list_slice<From, From + Count, T> |
| using ugmisc::type_list_slice = typename get_type_list_slice<From, To, T>::type |
| T | A type_list. |
Takes the types from the From index up to but not including the To index, and turns them into an ugmisc::type_list.
| using ugmisc::type_list_suffix = type_list_slice<T::size - Count, T::size, T> |
Aliases an ugmisc::type_list with the last Count members of the type_list template parameter T.