dune-common 2.1.1
Public Types | Public Member Functions | Static Public Attributes
Dune::FirstTypeIndex< Tuple, T, start > Struct Template Reference

Find the first occurance of a type in a tuple. More...

#include <dune/common/tupleutility.hh>

Inheritance diagram for Dune::FirstTypeIndex< Tuple, T, start >:
Inheritance graph

List of all members.

Public Types

typedef T value_type
 type of value
typedef integral_constant< T, v > type
 type of this class itself

Public Member Functions

 operator value_type ()
 conversion to value_type/T

Static Public Attributes

static const T value = v
 value this type was generated for

Detailed Description

template<class Tuple, class T, std::size_t start = 0>
struct Dune::FirstTypeIndex< Tuple, T, start >

Find the first occurance of a type in a tuple.

Template Parameters:
TupleThe tuple type to search in.
TType to search for.
startFirst index to try. This can be adjusted to skip leading tuple elements.

This class can search for a particular type in tuple. It will check each type in the tuple in turn, and set its member constant value to the index of the first occurance of type was found. If the type was not found, a static_assert is triggered.


Member Typedef Documentation

template<class T, T v>
typedef integral_constant<T,v> Dune::integral_constant< T, v >::type [inherited]

type of this class itself

template<class T, T v>
typedef T Dune::integral_constant< T, v >::value_type [inherited]

type of value


Member Function Documentation

template<class T, T v>
Dune::integral_constant< T, v >::operator value_type ( ) [inline, inherited]

conversion to value_type/T


Member Data Documentation

template<class T, T v>
const T Dune::integral_constant< T, v >::value = v [static, inherited]

value this type was generated for

Reimplemented in Dune::Int2Type< N >.

Referenced by Dune::integral_constant< int, N >::operator value_type().


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