3#ifndef DUNE_LOCALFUNCTIONS_COMMON_LOCALINTERPOLATION_HH
4#define DUNE_LOCALFUNCTIONS_COMMON_LOCALINTERPOLATION_HH
18 template<
class Domain,
class Range>
19 struct FunctionWithEvaluate
22 auto require(F&& f) ->
decltype(
23 f.evaluate(std::declval<Domain>(), std::declval<Range&>())
28 template<
class Domain>
29 struct FunctionWithCallOperator
32 auto require(F&& f) ->
decltype(
33 f(std::declval<Domain>())
39 template<
class Domain,
class Range,
class F,
40 std::enable_if_t<models<FunctionWithEvaluate<Domain, Range>, F>(),
int> = 0>
41 decltype(
auto) makeFunctionWithEvaluate(const F& f)
48 template<
class Domain,
class Range,
class F,
49 std::enable_if_t<not models<FunctionWithEvaluate<Domain, Range>, F>(),
int> = 0>
50 decltype(
auto) makeFunctionWithEvaluate(const F& f)
52 return makeVirtualFunction<Domain, Range>(std::cref(f));
57 template<
class Domain,
class F,
58 std::enable_if_t<models<FunctionWithCallOperator<Domain>, F>(),
int> = 0>
59 decltype(
auto) makeFunctionWithCallOperator(const F& f)
66 template<
class Domain,
class F,
67 std::enable_if_t<not models<FunctionWithCallOperator<std::decay_t<Domain> >, F>(),
int> = 0>
68 decltype(
auto) makeFunctionWithCallOperator(const F& f)
70 return [&](
auto&& x) {
71 typename std::decay_t<F>::Traits::RangeType y;
Infrastructure for concepts.
Simple base class templates for functions.
Dune namespace.
Definition: alignedallocator.hh:14