Specialisation of piranha::safe_cast() for conversions involving piranha::real.
More...
#include <piranha/real.hpp>
|
template<typename T = To, integral_enabler< T > = 0> |
T | operator() (const real &r) const |
| Call operator, real to integral overload. More...
|
|
template<typename T = To, rational_enabler< T > = 0> |
T | operator() (const real &r) const |
| Call operator, real to rational overload. More...
|
|
template<typename To, typename From>
struct piranha::safe_cast_impl< To, From, sc_real_enabler< To, From > >
Specialisation of piranha::safe_cast() for conversions involving piranha::real.
- Note
- This specialisation is enabled if
To
is an integral type, piranha::mp_integer or piranha::mp_rational, and From
is piranha::real.
Definition at line 2269 of file real.hpp.
◆ operator()() [1/2]
template<typename To , typename From >
template<typename T = To, integral_enabler< T > = 0>
Call operator, real to integral overload.
- Note
- This operator is enabled if
To
is an integral type or an instance of piranha::mp_integer.
The conversion will succeed if r
is a finite integral value representable by the target type.
- Parameters
-
- Returns
r
converted to To
.
- Exceptions
-
Definition at line 2293 of file real.hpp.
◆ operator()() [2/2]
template<typename To , typename From >
template<typename T = To, rational_enabler< T > = 0>
The documentation for this struct was generated from the following file: