piranha  0.10
piranha::math::evaluate_impl< T, U, typename > Class Template Reference

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...

## Detailed Description

### template<typename T, typename U, typename = void> class piranha::math::evaluate_impl< T, U, typename >

Default functor for the implementation of piranha::math::evaluate().

This functor can be specialised via the std::enable_if mechanism.

Definition at line 753 of file math.hpp.

## ◆ operator()()

template<typename T , typename U , typename = void>
template<typename T1 , typename U1 >
 ret_type piranha::math::evaluate_impl< T, U, typename >::operator() ( const T1 & x, const symbol_fmap< U1 > & ) const
inline

Call operator.

Note
This operator is enabled only if the procedure outlined below for the creation of the return value succeeds.

The implementation follows these rules:

• if 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;
• otherwise, a copy of 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.

Parameters
 x the evaluation argument.
Returns
an instance of the return type constructed from x.
Exceptions
 unspecified any exception thrown by the invoked constructors.

Definition at line 787 of file math.hpp.

The documentation for this class was generated from the following file: