piranha  0.10
Public Member Functions | List of all members
piranha::safe_cast_impl< To, From, mp_integer_safe_cast_enabler< To, From > > Struct Template Reference

Specialisation of piranha::safe_cast() for conversions involving piranha::mp_integer. More...

#include <piranha/mp_integer.hpp>

Public Member Functions

To operator() (const From &x) const
 Call operator. More...
 

Detailed Description

template<typename To, typename From>
struct piranha::safe_cast_impl< To, From, mp_integer_safe_cast_enabler< To, From > >

Specialisation of piranha::safe_cast() for conversions involving piranha::mp_integer.

Note
This specialisation is enabled in the following cases:

Definition at line 1032 of file mp_integer.hpp.

Member Function Documentation

◆ operator()()

template<typename To , typename From >
To piranha::safe_cast_impl< To, From, mp_integer_safe_cast_enabler< To, From > >::operator() ( const From &  x) const
inline

Call operator.

Parameters
xinput value to be converted.
Returns
x converted to To.
Exceptions
piranha::safe_cast_failureif:
  • the input float is not finite or if it has a nonzero fractional part,
  • the target integral type To cannot represent the value of the input piranha::mp_integer.
unspecifiedany exception thrown by the constructor of piranha::mp_integer from a floating-point.

Definition at line 1083 of file mp_integer.hpp.


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