8 auto Pin2SafeSeconds (
const chrono::time_point<CLOCK_T, DURATION_T>& tp) -> chrono::time_point<CLOCK_T, DURATION_T>
18 static constexpr auto kMin_ = chrono::time_point_cast<chrono::seconds> (
19 chrono::time_point<CLOCK_T, DURATION_T>{chrono::seconds{chrono::seconds::min ().count () + 1000}});
20 static constexpr auto kMax_ = chrono::time_point_cast<chrono::seconds> (
21 chrono::time_point<CLOCK_T, DURATION_T>{chrono::seconds{chrono::seconds::max ().count () - 1000}});
23 static constexpr auto kMin = chrono::time_point<CLOCK_T, DURATION_T>{chrono::seconds::min ()};
24 static constexpr auto kMax_ = chrono::time_point<CLOCK_T, DURATION_T>{chrono::seconds::max ()};
26#if qStroika_Foundation_Debug_AssertionsChecked
27 [[maybe_unused]]
static auto test1 = chrono::time_point_cast<chrono::seconds> (kMax_);
28 [[maybe_unused]]
static auto test2 = chrono::time_point_cast<chrono::seconds> (kMin_);
31 typename DURATION_T::rep tpSeconds = tp.time_since_epoch ().count () * DURATION_T::period::den / DURATION_T::period::num;
32 if (tpSeconds >
static_cast<typename DURATION_T::rep
> (chrono::seconds::max ().count ())) {
35 if (tpSeconds <
static_cast<typename DURATION_T::rep
> (chrono::seconds::min ().count ())) [[unlikely]] {