ugmisc 0.2
Miscellaneous C++ header library
Loading...
Searching...
No Matches
ugmisc::flatten< T > Struct Template Reference

Converts the template parameters into a type_list. More...

#include <ugmisc/typelist.hpp>

Public Types

using type = concatenate_type_lists_t<typename flatten<T>::type...>

Detailed Description

template<class... T>
struct ugmisc::flatten< T >

Converts the template parameters into a type_list.

Every parameter which is itself a type_list is unrolled. Every wrapped_list is unwrapped (but not recursively).

So for example:

flatten_t< typelist<A, B>, C, wrapped_list<typelist<D, E, F> >

is the type:

typelist<A, B, C, typelist<D, E, F> >

The implementation uses some single-arg template specializations to distinguish between template args which are type_list, wrapped_list, or neither. Then the non-specialised flatten concatenates the types produced by those.

A wrapped_list should be unwrapped once, whereas a type_list should be unwrapped recursively.


The documentation for this struct was generated from the following file: