Autoware.Auto
autoware::common::type_traits::intersect< TupleT1, TupleT2 > Struct Template Reference

A trait used to intersect types stored in tuples at compile time. The resulting typedef type will hold a tuple with the intersection of the types provided in the input tuples. More...

#include <type_traits.hpp>

Public Types

using type = decltype(make_intersection(std::make_index_sequence< std::tuple_size< TupleT1 >::value > {}))
 The resulting tuple type. More...
 

Static Public Member Functions

template<std::size_t... Indices>
static constexpr auto make_intersection (std::index_sequence< Indices... >)
 Intersect the types. More...
 

Detailed Description

template<typename TupleT1, typename TupleT2>
struct autoware::common::type_traits::intersect< TupleT1, TupleT2 >

A trait used to intersect types stored in tuples at compile time. The resulting typedef type will hold a tuple with the intersection of the types provided in the input tuples.

Taken from https://stackoverflow.com/a/41200732/1763680

Template Parameters
TupleT1Tuple 1
TupleT2Tuple 2

Member Typedef Documentation

◆ type

template<typename TupleT1 , typename TupleT2 >
using autoware::common::type_traits::intersect< TupleT1, TupleT2 >::type = decltype(make_intersection(std::make_index_sequence<std::tuple_size<TupleT1>::value> {}))

The resulting tuple type.

Member Function Documentation

◆ make_intersection()

template<typename TupleT1 , typename TupleT2 >
template<std::size_t... Indices>
static constexpr auto autoware::common::type_traits::intersect< TupleT1, TupleT2 >::make_intersection ( std::index_sequence< Indices... >  )
inlinestaticconstexpr

Intersect the types.

This function "iterates" over the types in TupleT1 and checks if those are in TupleT2. If this is true, these types are concatenated into a new tuple.


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