fmt::safe_duration_cast::lossless_integral_conversion

lossless_integral_conversion overloads

Synopses

Declared in <fmt/chrono.h>

Converts from to To, without loss, when From and To have the same signedness. DEPRECATED!

template<
    typename To,
    typename From>
constexpr
To
lossless_integral_conversion(
    From const from,
    int& ec);
» more...

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

template<
    typename To,
    typename From>
constexpr
To
lossless_integral_conversion(
    From const from,
    int& ec);
» more...

Converts from to To when From and To are the same type; always lossless.

template<
    typename To,
    typename From>
constexpr
To
lossless_integral_conversion(
    From const from,
    int& ec);
» more...

Return Value

  • The converted value, or a value-initialized To if ec is set.
  • from, unchanged.

Parameters

NameDescription
fromThe value to convert.
ecSet to a nonzero value if from does not fit in To.