BloombergLP::bsls::TimeInterval::asDuration

Return the value of this time interval as a std::chrono::duration object. This function participates in overloading if DURATION_TYPE is actually an std::chrono::duration instance, and if it has not a floating point representation. The behavior is undefined unless the total number of nanoseconds can be represented using a DURATION_TYPE. Note that the return value may be negative.

Synopsis

Declared in <bsls_timeinterval.h>

template<class DURATION_TYPE>
constexpr
DURATION_TYPE
asDuration() const
requires TimeInterval_IsDuration<DURATION_TYPE>::value &&
              !TimeInterval_RepTraits<typename DURATION_TYPE::rep>::k_IS_FLOAT;