STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
stapl::compute_type_parameters< DefaultParamsTuple, OptionalParams > Struct Template Reference

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...

Detailed Description

template<typename DefaultParamsTuple, typename ... OptionalParams>
struct stapl::compute_type_parameters< DefaultParamsTuple, OptionalParams >

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.

Template Parameters
DefaultParamsTupleA tuple containing a list of default values for optional template parameters.
OptionalParamsAny 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; };


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