tmp/tmpa8uuf4os/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Overview <a id="time.zone.zonedtime.overview">[[time.zone.zonedtime.overview]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std::chrono {
|
| 5 |
+
template<class Duration, class TimeZonePtr = const time_zone*>
|
| 6 |
+
class zoned_time {
|
| 7 |
+
public:
|
| 8 |
+
using duration = common_type_t<Duration, seconds>;
|
| 9 |
+
|
| 10 |
+
private:
|
| 11 |
+
TimeZonePtr zone_; // exposition only
|
| 12 |
+
sys_time<duration> tp_; // exposition only
|
| 13 |
+
|
| 14 |
+
using traits = zoned_traits<TimeZonePtr>; // exposition only
|
| 15 |
+
|
| 16 |
+
public:
|
| 17 |
+
zoned_time();
|
| 18 |
+
zoned_time(const zoned_time&) = default;
|
| 19 |
+
zoned_time& operator=(const zoned_time&) = default;
|
| 20 |
+
|
| 21 |
+
zoned_time(const sys_time<Duration>& st);
|
| 22 |
+
explicit zoned_time(TimeZonePtr z);
|
| 23 |
+
explicit zoned_time(string_view name);
|
| 24 |
+
|
| 25 |
+
template<class Duration2>
|
| 26 |
+
zoned_time(const zoned_time<Duration2, TimeZonePtr>& zt);
|
| 27 |
+
|
| 28 |
+
zoned_time(TimeZonePtr z, const sys_time<Duration>& st);
|
| 29 |
+
zoned_time(string_view name, const sys_time<Duration>& st);
|
| 30 |
+
|
| 31 |
+
zoned_time(TimeZonePtr z, const local_time<Duration>& tp);
|
| 32 |
+
zoned_time(string_view name, const local_time<Duration>& tp);
|
| 33 |
+
zoned_time(TimeZonePtr z, const local_time<Duration>& tp, choose c);
|
| 34 |
+
zoned_time(string_view name, const local_time<Duration>& tp, choose c);
|
| 35 |
+
|
| 36 |
+
template<class Duration2, class TimeZonePtr2>
|
| 37 |
+
zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& zt);
|
| 38 |
+
template<class Duration2, class TimeZonePtr2>
|
| 39 |
+
zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& zt, choose);
|
| 40 |
+
|
| 41 |
+
template<class Duration2, class TimeZonePtr2>
|
| 42 |
+
zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt);
|
| 43 |
+
template<class Duration2, class TimeZonePtr2>
|
| 44 |
+
zoned_time(string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt, choose);
|
| 45 |
+
|
| 46 |
+
zoned_time& operator=(const sys_time<Duration>& st);
|
| 47 |
+
zoned_time& operator=(const local_time<Duration>& ut);
|
| 48 |
+
|
| 49 |
+
operator sys_time<duration>() const;
|
| 50 |
+
explicit operator local_time<duration>() const;
|
| 51 |
+
|
| 52 |
+
TimeZonePtr get_time_zone() const;
|
| 53 |
+
local_time<duration> get_local_time() const;
|
| 54 |
+
sys_time<duration> get_sys_time() const;
|
| 55 |
+
sys_info get_info() const;
|
| 56 |
+
};
|
| 57 |
+
|
| 58 |
+
zoned_time() -> zoned_time<seconds>;
|
| 59 |
+
|
| 60 |
+
template<class Duration>
|
| 61 |
+
zoned_time(sys_time<Duration>)
|
| 62 |
+
-> zoned_time<common_type_t<Duration, seconds>>;
|
| 63 |
+
|
| 64 |
+
template<class TimeZonePtrOrName>
|
| 65 |
+
using time-zone-representation = // exposition only
|
| 66 |
+
conditional_t<is_convertible_v<TimeZonePtrOrName, string_view>,
|
| 67 |
+
const time_zone*,
|
| 68 |
+
remove_cvref_t<TimeZonePtrOrName>>;
|
| 69 |
+
|
| 70 |
+
template<class TimeZonePtrOrName>
|
| 71 |
+
zoned_time(TimeZonePtrOrName&&)
|
| 72 |
+
-> zoned_time<seconds, time-zone-representation<TimeZonePtrOrName>>;
|
| 73 |
+
|
| 74 |
+
template<class TimeZonePtrOrName, class Duration>
|
| 75 |
+
zoned_time(TimeZonePtrOrName&&, sys_time<Duration>)
|
| 76 |
+
-> zoned_time<common_type_t<Duration, seconds>,
|
| 77 |
+
time-zone-representation<TimeZonePtrOrName>>;
|
| 78 |
+
|
| 79 |
+
template<class TimeZonePtrOrName, class Duration>
|
| 80 |
+
zoned_time(TimeZonePtrOrName&&, local_time<Duration>,
|
| 81 |
+
choose = choose::earliest)
|
| 82 |
+
-> zoned_time<common_type_t<Duration, seconds>,
|
| 83 |
+
time-zone-representation<TimeZonePtrOrName>>;
|
| 84 |
+
|
| 85 |
+
template<class Duration, class TimeZonePtrOrName, class TimeZonePtr2>
|
| 86 |
+
zoned_time(TimeZonePtrOrName&&, zoned_time<Duration, TimeZonePtr2>,
|
| 87 |
+
choose = choose::earliest)
|
| 88 |
+
-> zoned_time<common_type_t<Duration, seconds>,
|
| 89 |
+
time-zone-representation<TimeZonePtrOrName>>;
|
| 90 |
+
}
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
`zoned_time` represents a logical pairing of a `time_zone` and a
|
| 94 |
+
`time_point` with precision `Duration`. `zoned_time<Duration>` maintains
|
| 95 |
+
the invariant that it always refers to a valid time zone and represents
|
| 96 |
+
a point in time that exists and is not ambiguous in that time zone.
|
| 97 |
+
|
| 98 |
+
If `Duration` is not a specialization of `chrono::duration`, the program
|
| 99 |
+
is ill-formed.
|
| 100 |
+
|
| 101 |
+
Every constructor of `zoned_time` that accepts a `string_view` as its
|
| 102 |
+
first parameter does not participate in class template argument
|
| 103 |
+
deduction [[over.match.class.deduct]].
|
| 104 |
+
|