Dune Core Modules (2.5.0)
Dune::FirstPredicateIndex< Tuple, Predicate, start, size > Class Template Reference
Finding the index of a certain type in a std::tuple. More...
#include <dune/common/tupleutility.hh>
Detailed Description
template<class Tuple, template< class > class Predicate, std::size_t start = 0, std::size_t size = std::tuple_size<Tuple>::value>
class Dune::FirstPredicateIndex< Tuple, Predicate, start, size >
class Dune::FirstPredicateIndex< Tuple, Predicate, start, size >
Finding the index of a certain type in a std::tuple.
- Template Parameters
-
Tuple The std::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 instantiated, it should contain a static member constant value
which should be convertible to bool. A type is accepted ifvalue
istrue
, 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 std::tuple.
This class can search for a type in std::tuple. It will apply the predicate to each type in std::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.
The documentation for this class was generated from the following file:
- dune/common/tupleutility.hh
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Nov 23, 23:29, 2024)