| 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 | |
| 691 | constexpr TDuration operator-(const TInstant& l, const TInstant& r) noexcept { |