MCPcopy Create free account
hub / github.com/catboost/catboost / DiffWithSaturation

Function DiffWithSaturation

util/datetime/base.h:684–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682
683 template <typename T>
684 static constexpr T DiffWithSaturation(T a, T b) {
685 static_assert(!std::numeric_limits<T>::is_signed, "expect !std::numeric_limits<T>::is_signed");
686
687 return a < b ? 0 : a - b;
688 }
689} // namespace NDateTimeHelpers
690
691constexpr TDuration operator-(const TInstant& l, const TInstant& r) noexcept {

Callers 1

operator-Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected