3 #ifndef DUNE_FUNCTION_HH_SILENCE_DEPRECATION
4 #warning This file is deprecated after Dune 2.7! Use C++ function objects and std::function stuff instead!
6 #undef DUNE_FUNCTION_HH_SILENCE_DEPRECATION
9 #ifndef DUNE_FUNCTION_HH
10 #define DUNE_FUNCTION_HH
34 template <
class Domain,
class Range>
36 [[deprecated(
"Dune::Function is deprecated after Dune 2.7. Use C++ "
37 "function objects instead!")]]
40 typedef typename std::remove_cv<typename std::remove_reference< Domain >::type >::type RawDomainType;
41 typedef typename std::remove_cv<typename std::remove_reference< Range >::type >::type RawRangeType;
80 template <
class DomainType,
class RangeType>
82 [[deprecated(
"Dune::VirtualFunction is deprecated after Dune 2.7. Use C++ "
83 "function objects and std::function instead!")]]
103 template<
typename Domain,
typename Range,
typename F>
104 class LambdaVirtualFunction final
108 LambdaVirtualFunction(F&& f)
112 LambdaVirtualFunction(
const F& f)
116 void evaluate(
const Domain& x, Range& y)
const override
147 template<
typename Domain,
typename Range,
typename F>
148 [[deprecated(
"Dune::LambdaVirtualFunction is deprecated after Dune 2.7. "
149 "Use std::function instead!")]]
150 Impl::LambdaVirtualFunction< Domain, Range, std::decay_t<F> >
153 return {std::forward<F>(f)};
Definition of the DUNE_DEPRECATED macro for the case that config.h is not available.
Traits for type conversions and type information.
Impl::LambdaVirtualFunction< Domain, Range, std::decay_t< F > > makeVirtualFunction(F &&f)
make VirtualFunction out of a function object
Definition: function.hh:151
#define DUNE_NO_DEPRECATED_END
Ignore deprecation warnings (end)
Definition: deprecated.hh:61
#define DUNE_NO_DEPRECATED_BEGIN
Ignore deprecation warnings (start)
Definition: deprecated.hh:55
Dune namespace.
Definition: alignedallocator.hh:11
Base class template for function classes.
Definition: function.hh:39
RawDomainType DomainType
Raw type of output variable with removed reference and constness.
Definition: function.hh:49
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:46
Traits class containing raw types.
Definition: function.hh:53
RawDomainType DomainType
Definition: function.hh:54
RawRangeType RangeType
Definition: function.hh:55
Virtual base class template for function classes.
Definition: function.hh:85
virtual ~VirtualFunction()
Definition: function.hh:89
Function< const DomainType &, RangeType & >::Traits Traits
Definition: function.hh:87
virtual void evaluate(const typename Traits::DomainType &x, typename Traits::RangeType &y) const =0
Function evaluation.