cprover
numeric_castt< T, typename std::enable_if< std::is_integral< T >::value >::type > Struct Template Reference

Convert mp_integer or expr to any integral type. More...

#include <arith_tools.h>

Public Member Functions

optionalt< T > operator() (const mp_integer &mpi) const
 
optionalt< T > operator() (const exprt &expr) const
 
optionalt< T > operator() (const constant_exprt &expr) const
 

Static Private Member Functions

template<typename U = T, typename std::enable_if< std::is_signed< U >::value, int >::type = 0>
static auto get_val (const mp_integer &mpi) -> decltype(mpi.to_long())
 
template<typename U = T, typename std::enable_if<!std::is_signed< U >::value, int >::type = 0>
static auto get_val (const mp_integer &mpi) -> decltype(mpi.to_ulong())
 

Detailed Description

template<typename T>
struct numeric_castt< T, typename std::enable_if< std::is_integral< T >::value >::type >

Convert mp_integer or expr to any integral type.

Definition at line 60 of file arith_tools.h.

Member Function Documentation

◆ get_val() [1/2]

template<typename T >
template<typename U = T, typename std::enable_if< std::is_signed< U >::value, int >::type = 0>
static auto numeric_castt< T, typename std::enable_if< std::is_integral< T >::value >::type >::get_val ( const mp_integer mpi) -> decltype(mpi.to_long())
inlinestaticprivate

Definition at line 67 of file arith_tools.h.

◆ get_val() [2/2]

template<typename T >
template<typename U = T, typename std::enable_if<!std::is_signed< U >::value, int >::type = 0>
static auto numeric_castt< T, typename std::enable_if< std::is_integral< T >::value >::type >::get_val ( const mp_integer mpi) -> decltype(mpi.to_ulong())
inlinestaticprivate

Definition at line 75 of file arith_tools.h.

◆ operator()() [1/3]

template<typename T >
optionalt<T> numeric_castt< T, typename std::enable_if< std::is_integral< T >::value >::type >::operator() ( const constant_exprt expr) const
inline

Definition at line 110 of file arith_tools.h.

◆ operator()() [2/3]

template<typename T >
optionalt<T> numeric_castt< T, typename std::enable_if< std::is_integral< T >::value >::type >::operator() ( const exprt expr) const
inline

Definition at line 101 of file arith_tools.h.

◆ operator()() [3/3]

template<typename T >
optionalt<T> numeric_castt< T, typename std::enable_if< std::is_integral< T >::value >::type >::operator() ( const mp_integer mpi) const
inline

Definition at line 82 of file arith_tools.h.


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