4#ifndef TETL_CHRONO_FLOOR_HPP
5#define TETL_CHRONO_FLOOR_HPP
7#include <etl/_chrono/duration_cast.hpp>
8#include <etl/_chrono/time_point_cast.hpp>
9#include <etl/_type_traits/is_arithmetic.hpp>
17template <
typename To,
typename Rep,
typename Period>
18 requires(detail::is_duration_v<To>)
19[[nodiscard]]
constexpr auto
22 auto const t{duration_cast<To>(d)};
24 return To(t.count() -
static_cast<
typename To::rep>(1));
30template <
typename To,
typename Clock,
typename Duration>
31 requires(detail::is_duration_v<To>)
34 return time_point<Clock, To>(floor<To>(tp.time_since_epoch()));
constexpr auto floor(duration< Rep, Period > const &d) noexcept(is_arithmetic_v< Rep > and is_arithmetic_v< typename To::rep >) -> To
Returns the greatest duration t representable in ToDuration that is less or equal to d....
Definition floor.hpp:20
constexpr auto floor(time_point< Clock, Duration > const &tp) -> time_point< Clock, To >
Definition floor.hpp:32
Definition adjacent_find.hpp:9
Class template etl::chrono::duration represents a time interval.
Definition duration.hpp:32
Class template time_point represents a point in time. It is implemented as if it stores a value of ty...
Definition time_point.hpp:22