di 0.1.0
Loading...
Searching...
No Matches
time_point_cast.h
Go to the documentation of this file.
1#pragma once
2
5#include "di/meta/core.h"
6
7namespace di::chrono {
8namespace detail {
9 template<concepts::InstanceOf<Duration> To>
10 struct TimePointCastFunction {
11 template<typename Clock, typename Duration>
12 constexpr auto operator()(TimePoint<Clock, Duration> const& from) const -> TimePoint<Clock, To> {
13 return TimePoint<Clock, To>(chrono::duration_cast<To>(from.time_since_epoch()));
14 }
15 };
16}
17
18template<concepts::InstanceOf<Duration> To>
19constexpr inline auto time_point_cast = detail::TimePointCastFunction<To> {};
20}
21
22namespace di {
24}
Definition duration.h:9
constexpr auto time_point_cast
Definition time_point_cast.h:19
constexpr auto duration_cast
Definition duration_cast.h:25
Definition any_storable.h:9