From Jason Turner

[time.clock.cast.sys]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpt4zn58zl/{from.md → to.md} +47 -0
tmp/tmpt4zn58zl/{from.md → to.md} RENAMED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Conversions between `system_clock` and other clocks <a id="time.clock.cast.sys">[[time.clock.cast.sys]]</a>
2
+
3
+ ``` cpp
4
+ template<class SourceClock>
5
+ struct clock_time_conversion<system_clock, SourceClock> {
6
+ template<class Duration>
7
+ auto operator()(const time_point<SourceClock, Duration>& t) const
8
+ -> decltype(SourceClock::to_sys(t));
9
+ };
10
+ ```
11
+
12
+ ``` cpp
13
+ template<class Duration>
14
+ auto operator()(const time_point<SourceClock, Duration>& t) const
15
+ -> decltype(SourceClock::to_sys(t));
16
+ ```
17
+
18
+ *Constraints:* `SourceClock::to_sys(t)` is well-formed.
19
+
20
+ *Mandates:* `SourceClock::to_sys(t)` returns a `sys_time<Duration>`,
21
+ where `Duration` is a valid `chrono::duration` specialization.
22
+
23
+ *Returns:* `SourceClock::to_sys(t)`.
24
+
25
+ ``` cpp
26
+ template<class DestClock>
27
+ struct clock_time_conversion<DestClock, system_clock> {
28
+ template<class Duration>
29
+ auto operator()(const sys_time<Duration>& t) const
30
+ -> decltype(DestClock::from_sys(t));
31
+ };
32
+ ```
33
+
34
+ ``` cpp
35
+ template<class Duration>
36
+ auto operator()(const sys_time<Duration>& t) const
37
+ -> decltype(DestClock::from_sys(t));
38
+ ```
39
+
40
+ *Constraints:* `DestClock::from_sys(t)` is well-formed.
41
+
42
+ *Mandates:* `DestClock::from_sys(t)` returns a
43
+ `time_point<DestClock, Duration>`, where `Duration` is a valid
44
+ `chrono::duration` specialization.
45
+
46
+ *Returns:* `DestClock::from_sys(t)`.
47
+