Metafunction that returns a tuple of types to a template instantiation that should be used for a set of optional template parameters. This allows writers to avoid use of default template parameters, reducing error message and symbol table sizes. More...
Metafunction that returns a tuple of types to a template instantiation that should be used for a set of optional template parameters. This allows writers to avoid use of default template parameters, reducing error message and symbol table sizes.
DefaultParamsTuple | A tuple containing a list of default values for optional template parameters. |
OptionalParams | Any optional parameters explicitly passed to a template instantiation. The size of DefaultParams defines the maximum size of this list of parameters. |
For example, given this class template with two optional parameter:
template<typename T1, typename T2, typename O1 = foo, typename O2 = bar> class baz { typedef O1 optional1_type; typedef O2 optional2_type; };
Could be transformed to the following:
template<typename T1, typename T2, typename ...OptionalParams> class baz { typedef typename compute_type_parameters< tuple<O1, O2> OptionalParams... >::type param_types;
typedef typename tuple_element<0, param_types>::type optional1_type; typedef typename tuple_element<1, param_types>::type optional2_type; };