5#ifndef DUNE_FUNCTION_HH_SILENCE_DEPRECATION
6#warning This file is deprecated after Dune 2.7! Use C++ function objects and std::function stuff instead!
8#undef DUNE_FUNCTION_HH_SILENCE_DEPRECATION
11#ifndef DUNE_FUNCTION_HH
12#define DUNE_FUNCTION_HH
36 template <
class Domain,
class Range>
38 [[deprecated(
"Dune::Function is deprecated after Dune 2.7. Use C++ "
39 "function objects instead!")]]
42 typedef typename std::remove_cv<typename std::remove_reference< Domain >::type >::type RawDomainType;
43 typedef typename std::remove_cv<typename std::remove_reference< Range >::type >::type RawRangeType;
82 template <
class DomainType,
class RangeType>
84 [[deprecated(
"Dune::VirtualFunction is deprecated after Dune 2.7. Use C++ "
85 "function objects and std::function instead!")]]
105 template<
typename Domain,
typename Range,
typename F>
106 class LambdaVirtualFunction final
110 LambdaVirtualFunction(F&& f)
114 LambdaVirtualFunction(
const F& f)
118 void evaluate(
const Domain& x, Range& y)
const override
149 template<
typename Domain,
typename Range,
typename F>
150 [[deprecated(
"Dune::LambdaVirtualFunction is deprecated after Dune 2.7. "
151 "Use std::function instead!")]]
152 Impl::LambdaVirtualFunction< Domain, Range, std::decay_t<F> >
155 return {std::forward<F>(f)};
Traits for type conversions and type information.
Definition of the DUNE_NO_DEPRECATED_* macros.
Impl::LambdaVirtualFunction< Domain, Range, std::decay_t< F > > makeVirtualFunction(F &&f)
make VirtualFunction out of a function object
Definition function.hh:153
#define DUNE_NO_DEPRECATED_END
Ignore deprecation warnings (end)
Definition deprecated.hh:38
#define DUNE_NO_DEPRECATED_BEGIN
Ignore deprecation warnings (start)
Definition deprecated.hh:32
Dune namespace.
Definition alignedallocator.hh:13
Base class template for function classes.
Definition function.hh:41
RawDomainType DomainType
Raw type of output variable with removed reference and constness.
Definition function.hh:51
void evaluate(const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Function evaluation.
RawRangeType RangeType
Raw type of input variable with removed reference and constness.
Definition function.hh:48
Traits class containing raw types.
Definition function.hh:55
RawDomainType DomainType
Definition function.hh:56
RawRangeType RangeType
Definition function.hh:57
Virtual base class template for function classes.
Definition function.hh:87
Function< constDomainType &, RangeType & >::Traits Traits
Definition function.hh:89
virtual ~VirtualFunction()
Definition function.hh:91
virtual void evaluate(const typename Traits::DomainType &x, typename Traits::RangeType &y) const =0
Function evaluation.