piranha
0.10
|
Default functor for the implementation of piranha::math::evaluate(). More...
#include <piranha/math.hpp>
Public Member Functions | |
template<typename T1 , typename U1 > | |
ret_type< T1, U1 > | operator() (const T1 &x, const symbol_fmap< U1 > &) const |
Call operator. More... | |
Default functor for the implementation of piranha::math::evaluate().
This functor can be specialised via the std::enable_if
mechanism.
|
inline |
Call operator.
The implementation follows these rules:
a+b
(with a
of type T1
and b
of type U1
) is a well-formed expression of type R
, then the return value will be an instance of R
constructed from x
;x
will be returned.If the return value cannot be constructed from x
or if its type does not satisfy piranha::is_returnable, the operator will be disabled.
The intent of this default-implementation of piranha::math::evaluate() is to either promote x
to the common type of T
and U
, if it exists, or just return x
as-is if a common type does not exist.
x | the evaluation argument. |
x
.unspecified | any exception thrown by the invoked constructors. |