Public Types | Static Private Attributes | List of all members
util::extract_to_tuple_type< SrcTuple, Extractor, TargetClass > Struct Template Reference

Returns type TargetClass<U...> from a SrcTuple<T...>. More...

#include <TupleLookupByTag.h>

Public Types

using type = typename details::extract_to_tuple_type_impl< TargetClass, Extractor, SrcTuple, 0U, N >::type
 

Static Private Attributes

static constexpr std::size_t N = std::tuple_size<SrcTuple>()
 

Detailed Description

template<typename SrcTuple, template< typename T, typename... > class Extractor, template< typename... > class TargetClass>
struct util::extract_to_tuple_type< SrcTuple, Extractor, TargetClass >

Returns type TargetClass<U...> from a SrcTuple<T...>.

Template Parameters
SrcTuplea tuple-like type enclosing a list of types
Extractorclass extracting the U type from each T
TargetClassthe template type of the class to be returned
See also
extract_to_tuple_type_t, to_tuple

The input template argument SrcTuple is an object supporting std::tuple_size and std::tuple_element to return all its contained types.

template <typename... T>
struct MyFirstClass {
// ...
};
template <typename... T>
struct MySecondClass {
// ...
};
using DataClass = MyFirstDataClass<int, char, std::string>;
using PointerDataClass = util::extract_to_tuple_type
<DataClass, std::add_pointer, MySecondClass>;

will yield a PointerDataClass as MySecondClass<int*, char*, std::string*> (note that in this partial example MyFirstClass is not yet a tuple-like type).

The extractor is a trait whose first element is the type to be transformed, and whose member type holds the transformed type.

Note
The extractor must be able to return a type for each and every type in SrcTuple.

Definition at line 195 of file TupleLookupByTag.h.

Member Typedef Documentation

template<typename SrcTuple, template< typename T, typename... > class Extractor, template< typename... > class TargetClass>
using util::extract_to_tuple_type< SrcTuple, Extractor, TargetClass >::type = typename details::extract_to_tuple_type_impl <TargetClass, Extractor, SrcTuple, 0U, N>::type

Definition at line 1211 of file TupleLookupByTag.h.

Member Data Documentation

template<typename SrcTuple, template< typename T, typename... > class Extractor, template< typename... > class TargetClass>
constexpr std::size_t util::extract_to_tuple_type< SrcTuple, Extractor, TargetClass >::N = std::tuple_size<SrcTuple>()
staticprivate

Definition at line 1208 of file TupleLookupByTag.h.


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