dune-common 2.1.1
|
Finding the index of a certain in a tuple. More...
#include <dune/common/tupleutility.hh>
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 |
Finding the index of a certain in a tuple.
Tuple | The tuple type to search in. |
Predicate | Predicate which tells FirstPredicateIndex which types in Tuple to accept. This should be a class template taking a single type template argument. When instanciated, it should contain a static member constant value which should be convertible to bool. A type is accepted if value is true , otherwise it is rejected and the next type is tried. Look at IsType for a sample implementation. |
start | First index to try. This can be adjusted to skip leading tuple elements. |
size | This parameter is an implementation detail and should not be adjusted by the users of this class. It should always be equal to the size of the tuple. |
This class can search for a type in tuple. It will apply the predicate to each type in tuple in turn, and set its member constant value
to the index of the first type that was accepted by the predicate. If none of the types are accepted by the predicate, a static_assert is triggered.
typedef integral_constant<T,v> Dune::integral_constant< T, v >::type [inherited] |
type of this class itself
typedef T Dune::integral_constant< T, v >::value_type [inherited] |
type of value
Dune::integral_constant< T, v >::operator value_type | ( | ) | [inline, inherited] |
conversion to value_type/T
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().