Functions
safe_duration_cast Namespace Reference

Functions

template<typename To , typename From , FMT_ENABLE_IF(!std::is_same< From, To >::value &&std::numeric_limits< From >::is_signed==std::numeric_limits< To >::is_signed) >
FMT_CONSTEXPR To lossless_integral_conversion (const From from, int &ec)
 
template<typename To , typename FromRep , typename FromPeriod , FMT_ENABLE_IF(std::is_integral< FromRep >::value) , FMT_ENABLE_IF(std::is_integral< typename To::rep >::value) >
To safe_duration_cast (std::chrono::duration< FromRep, FromPeriod > from, int &ec)
 
template<typename To , typename From , FMT_ENABLE_IF(!std::is_same< From, To >::value) >
FMT_CONSTEXPR To safe_float_conversion (const From from, int &ec)
 

Function Documentation

template<typename To , typename From , FMT_ENABLE_IF(!std::is_same< From, To >::value &&std::numeric_limits< From >::is_signed==std::numeric_limits< To >::is_signed) >
FMT_CONSTEXPR To safe_duration_cast::lossless_integral_conversion ( const From  from,
int &  ec 
)

converts From to To, without loss. If the dynamic value of from can't be converted to To without loss, ec is set.

Definition at line 39 of file chrono.h.

template<typename To , typename FromRep , typename FromPeriod , FMT_ENABLE_IF(std::is_integral< FromRep >::value) , FMT_ENABLE_IF(std::is_integral< typename To::rep >::value) >
To safe_duration_cast::safe_duration_cast ( std::chrono::duration< FromRep, FromPeriod >  from,
int &  ec 
)

safe duration cast between integral durations

safe duration_cast between floating point durations

Definition at line 154 of file chrono.h.

template<typename To , typename From , FMT_ENABLE_IF(!std::is_same< From, To >::value) >
FMT_CONSTEXPR To safe_duration_cast::safe_float_conversion ( const From  from,
int &  ec 
)

converts From to To if possible, otherwise ec is set.

input output
NaN NaN
Inf Inf
normal, fits in output converted (possibly lossy)
normal, does not fit in output ec is set
subnormal best effort
-Inf -Inf

Definition at line 120 of file chrono.h.



plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:52