BloombergLP::bsls::TimeInterval::TimeInterval

Create a time interval having the value represented by the specified duration. Only integer representations of duration are supported (i.e. REP_TYPE is integer). If the duration can be represented exactly by an integer nanoseconds this constructor will be implicit. Otherwise, the constructor will be explicit. The behavior is undefined unless the duration can be converted to a valid TimeInterval object, whose seconds field may have any 64-bit signed integer value and nanoseconds field limited to the range [ -999,999,999..999,999,999 ]. Note that the current implementation of the lossy conversions (e.g., fractions of a nanosecond) truncates the values towards zero, however this behavior may change without notice in the future, so do not rely on this.

Synopsis

Declared in <bsls_timeinterval.h>

template<
    class REP_TYPE,
    class PERIOD_TYPE>
constexpr
TimeInterval(
    std::chrono::duration<REP_TYPE, PERIOD_TYPE> const& duration,
    int* = 0)
requires TimeInterval_DurationTraits<
                                   REP_TYPE,
                                   PERIOD_TYPE>::k_IMPLICIT_CONVERSION_ENABLED;