Lumiera  0.pre.03
»edit your freedom«
TupleConstructor< TYPES, _ElmMapper_ > Struct Template Reference

#include "lib/meta/tuple-helper.hpp"

Description

template<typename TYPES, template< class, class, size_t > class _ElmMapper_>
struct lib::meta::TupleConstructor< TYPES, _ElmMapper_ >

Extensible Adapter to construct a distinct tuple from some arbitrary source type.

This includes the possibility to re-map elements or element positions.

Template Parameters
TYPESsequence of types to use for the tuple
<em>ElmMapper</em>a template to extract each constructor argument from the source value. On invocation, we'll pick up the source type from the actual ctor argument, and then invoke this helper template iteratively for each component of the tuple, passing as template arguments
  • the source type, as picked up from the constructor
  • the target tuple type, i.e. Tuple<TYPES>
  • the actual index position of the tuple element to be initialised through this concrete instantiation.
Remarks
this design has several extension points. Pretty much any conceivable initialisation logic can be embodied in the _ElmMapper_ template. The sole requirement is that the concrete instance is assignable by the source type and convertible to the individual member type of the target tuple it is invoked for. Moreover, it is possible to build a generic element extractor, which will be specialised on base of the source type accepted.
See also
ExtractArg

Definition at line 238 of file tuple-helper.hpp.

Public Types

using SequenceIterator = typename BuildIdxIter< TYPES >::Ascending
 meta-sequence to drive instantiation of the ElmMapper
 

Public Member Functions

template<class SRC >
 TupleConstructor (SRC values)
 

Protected Member Functions

template<class SRC , size_t... idx>
 TupleConstructor (SRC values, IndexSeq< idx... >)
 
+ Inheritance diagram for TupleConstructor< TYPES, _ElmMapper_ >:
+ Collaboration diagram for TupleConstructor< TYPES, _ElmMapper_ >:

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