|
template<class T , class... Args> |
using | Dune::Functions::enableIfConstructible = typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type |
| Helper to constrain forwarding constructors. More...
|
|
template<template< class... > class T, class ArgTuple > |
using | Dune::Functions::ExpandTuple = typename Imp::ExpandTupleHelper< T, ArgTuple >::Type |
| Expand tuple arguments as template arguments. More...
|
|
template<template< class... > class F, class... Tuples> |
using | Dune::Functions::TransformTuple = typename Imp::TransformTupleHelper< F, Tuples... >::Type |
| Transform tuple types argument using type-functor. More...
|
|
|
template<class F , class... Args> |
static constexpr auto | Dune::Functions::Concept::isCallable () |
| Check if f is callable with given argument list. More...
|
|
template<class F , class... Args> |
static constexpr auto | Dune::Functions::Concept::isCallable (F &&, Args &&...) |
| Check if f is callable with given argument list. More...
|
|
template<class C , class I , class F , typename std::enable_if< Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int >::type = 0> |
auto | Dune::Functions::hybridIndexAccess (C &&c, const I &i, F &&f) -> decltype(f(c[i])) |
| Provide operator[] index-access for containers. More...
|
|
template<class Result , class C , class MultiIndex > |
Result | Dune::Functions::hybridMultiIndexAccess (C &&c, const MultiIndex &index) |
| Provide multi-index access by chaining operator[]. More...
|
|
template<class C , class MultiIndex , class IsFinal > |
constexpr decltype(auto) | Dune::Functions::resolveDynamicMultiIndex (C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal) |
| Provide multi-index access by chaining operator[]. More...
|
|
template<class C , class MultiIndex > |
constexpr decltype(auto) | Dune::Functions::resolveDynamicMultiIndex (C &&c, const MultiIndex &multiIndex) |
| Provide multi-index access by chaining operator[]. More...
|
|
template<class C , class MultiIndex > |
constexpr decltype(auto) | Dune::Functions::resolveStaticMultiIndex (C &&c, const MultiIndex &multiIndex) |
| Provide multi-index access by chaining operator[]. More...
|
|
template<std::size_t begin_t, std::size_t end_t, class F , class... Args> |
void | Dune::Functions::staticFindInRange (F &&f, Args &&... args) |
| Static find loop. More...
|
|
template<std::size_t end, class F , class size_type , class... Args> |
auto | Dune::Functions::forwardAsStaticIndex (const size_type &i, F &&f, Args &&... args) -> decltype(f(Dune::Indices::_0, std::forward< Args >(args)...)) |
| Transform dynamic index to static index_constant. More...
|
|
template<class F , class... T> |
auto | Dune::Functions::transformTuple (F &&f, const std::tuple< T... > &tuple) -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple, std::index_sequence_for< T... >{})) |
| Transform tuple value using a functor. More...
|
|
template<class F , class... T1, class... T2> |
auto | Dune::Functions::transformTuple (F &&f, const std::tuple< T1... > &tuple1, const std::tuple< T2... > &tuple2) -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple1, tuple2, std::index_sequence_for< T1... >{})) |
| Transform tuple value using a binary functor. More...
|
|
template<class Expression > |
auto | Dune::Functions::callableCheck (Expression f) |
| Create a predicate for checking validity of expressions. More...
|
|
template<class Check > |
auto | Dune::Functions::negatePredicate (Check check) |
| Negate given predicate. More...
|
|
Various helper classes and functions.
template<template< class... > class F, class... Tuples>
Transform tuple types argument using type-functor.
This is a template alias for a tuple whose i-th type is given by F<T1i,...,TMi> where T1i,...,TMi are the i-th types of the 1,...,M-th tuple of the given tuple list Tuples. Currently only M=1,2 are supported.
- Template Parameters
-
F | A template alias mapping 1,...,sizeof...(ArgTuple) types to a new one |
Tuples | A list of tuples |
template<std::size_t end, class F , class size_type , class... Args>
auto Dune::Functions::forwardAsStaticIndex |
( |
const size_type & |
i, |
|
|
F && |
f, |
|
|
Args &&... |
args |
|
) |
| -> decltype(f(Dune::Indices::_0, std::forward<Args>(args)...))
|
Transform dynamic index to static index_constant.
This will call the given function with index_constant where i is the dynamically provided index.
To achieve this the condition i==ii is checked subsequently for al static indices ii in the range 0,...,(end-1). In order to be able to compile this we require for all ii in this range that f(index_constant<ii>()) is well-formed and that the result type of it can be converted to the result type of f(index_constant<0>()). If i is not in this range, the returned value is f(index_constant<n-1>())
- Parameters
-
i | Dynamic index |
f | Function to call (e.g., a generic lambda) |
args | Additional arguments for f |
- Returns
- f(index_constant<i>(), args...)
template<class C , class I , class F , typename std::enable_if< Dune::models< Imp::Concept::HasDynamicIndexAccess< I >, C >(), int >::type = 0>
auto Dune::Functions::hybridIndexAccess |
( |
C && |
c, |
|
|
const I & |
i, |
|
|
F && |
f |
|
) |
| -> decltype(f(c[i]))
|
Provide operator[] index-access for containers.
This is the overload for types providing a operator[] for dynamic std::size_t arguments.
- Parameters
-
c | Container to access |
i | The index to use for accessing the container |
f | A functor to call with the result of operator[] |
template<class Result , class C , class MultiIndex >
Result Dune::Functions::hybridMultiIndexAccess |
( |
C && |
c, |
|
|
const MultiIndex & |
index |
|
) |
| |
Provide multi-index access by chaining operator[].
This provides access to a nested container by given multi-index. Internally this is resolved by recursive operator[]-calls with static or dynamic indices. Because this recursion must be terminated using a compile-time criterion, the result type must explicitly be provided. The recursion will terminate once the result can be converted to this result type.
- Template Parameters
-
- Parameters
-
c | Container to access |
index | Multi-index |
template<class C , class MultiIndex , class IsFinal >
constexpr decltype(auto) Dune::Functions::resolveDynamicMultiIndex |
( |
C && |
c, |
|
|
const MultiIndex & |
multiIndex, |
|
|
const IsFinal & |
isFinal |
|
) |
| |
|
constexpr |
Provide multi-index access by chaining operator[].
This provides access to a nested container by given dynamically sized multi-index. Internally this is resolved by recursive operator[]-calls with static or dynamic indices. Because this recursion must be terminated, a predicate is used to determine if a type is considered final for the multi-index resolution. Hence multi-index resolution is terminated for values where the criterion matches. In order to do this statically the predicate has to return its result as std::true_type or std::false_type.
If the entries of the multi-index are exhausted, additional [0] entries are used until the termination criterion is satisfied.
- Parameters
-
c | Container to access |
index | Multi-index |
isFinal | A predicate function checking if recursion should be terminated. |