tmp/tmp_06or5h8/{from.md → to.md}
RENAMED
|
@@ -11,17 +11,17 @@ public:
|
|
| 11 |
private:
|
| 12 |
duration d_; // exposition only
|
| 13 |
|
| 14 |
public:
|
| 15 |
// [time.point.cons], construct:
|
| 16 |
-
time_point(); // has value epoch
|
| 17 |
-
explicit time_point(const duration& d); // same as time_point() + d
|
| 18 |
template <class Duration2>
|
| 19 |
-
|
| 20 |
|
| 21 |
// [time.point.observer], observer:
|
| 22 |
-
duration time_since_epoch() const;
|
| 23 |
|
| 24 |
// [time.point.arithmetic], arithmetic:
|
| 25 |
time_point& operator+=(const duration& d);
|
| 26 |
time_point& operator-=(const duration& d);
|
| 27 |
|
|
@@ -37,27 +37,27 @@ If `Duration` is not an instance of `duration`, the program is
|
|
| 37 |
ill-formed.
|
| 38 |
|
| 39 |
#### `time_point` constructors <a id="time.point.cons">[[time.point.cons]]</a>
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
-
time_point();
|
| 43 |
```
|
| 44 |
|
| 45 |
*Effects:* Constructs an object of type `time_point`, initializing `d_`
|
| 46 |
with `duration::zero()`. Such a `time_point` object represents the
|
| 47 |
epoch.
|
| 48 |
|
| 49 |
``` cpp
|
| 50 |
-
time_point(const duration& d);
|
| 51 |
```
|
| 52 |
|
| 53 |
*Effects:* Constructs an object of type `time_point`, initializing `d_`
|
| 54 |
with `d`. Such a `time_point` object represents the epoch `+ d`.
|
| 55 |
|
| 56 |
``` cpp
|
| 57 |
template <class Duration2>
|
| 58 |
-
time_point(const time_point<clock, Duration2>& t);
|
| 59 |
```
|
| 60 |
|
| 61 |
*Remarks:* This constructor shall not participate in overload resolution
|
| 62 |
unless `Duration2` is implicitly convertible to `duration`.
|
| 63 |
|
|
@@ -65,11 +65,11 @@ unless `Duration2` is implicitly convertible to `duration`.
|
|
| 65 |
with `t.time_since_epoch()`.
|
| 66 |
|
| 67 |
#### `time_point` observer <a id="time.point.observer">[[time.point.observer]]</a>
|
| 68 |
|
| 69 |
``` cpp
|
| 70 |
-
duration time_since_epoch() const;
|
| 71 |
```
|
| 72 |
|
| 73 |
*Returns:* `d_`.
|
| 74 |
|
| 75 |
#### `time_point` arithmetic <a id="time.point.arithmetic">[[time.point.arithmetic]]</a>
|
|
@@ -106,89 +106,91 @@ static constexpr time_point max();
|
|
| 106 |
|
| 107 |
#### `time_point` non-member arithmetic <a id="time.point.nonmember">[[time.point.nonmember]]</a>
|
| 108 |
|
| 109 |
``` cpp
|
| 110 |
template <class Clock, class Duration1, class Rep2, class Period2>
|
| 111 |
-
time_point<Clock,
|
| 112 |
operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
|
| 113 |
```
|
| 114 |
|
| 115 |
-
*Returns:* `CT(lhs) +
|
|
|
|
| 116 |
|
| 117 |
``` cpp
|
| 118 |
template <class Rep1, class Period1, class Clock, class Duration2>
|
| 119 |
-
time_point<Clock,
|
| 120 |
operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 121 |
```
|
| 122 |
|
| 123 |
*Returns:* `rhs + lhs`.
|
| 124 |
|
| 125 |
``` cpp
|
| 126 |
template <class Clock, class Duration1, class Rep2, class Period2>
|
| 127 |
-
time_point<Clock,
|
| 128 |
operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
|
| 129 |
```
|
| 130 |
|
| 131 |
*Returns:* `lhs + (-rhs)`.
|
| 132 |
|
| 133 |
``` cpp
|
| 134 |
template <class Clock, class Duration1, class Duration2>
|
| 135 |
-
|
| 136 |
operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 137 |
```
|
| 138 |
|
| 139 |
*Returns:* `lhs.time_since_epoch() - rhs.time_since_epoch()`.
|
| 140 |
|
| 141 |
#### `time_point` comparisons <a id="time.point.comparisons">[[time.point.comparisons]]</a>
|
| 142 |
|
| 143 |
``` cpp
|
| 144 |
template <class Clock, class Duration1, class Duration2>
|
| 145 |
-
bool operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 146 |
```
|
| 147 |
|
| 148 |
*Returns:* `lhs.time_since_epoch() == rhs.time_since_epoch()`.
|
| 149 |
|
| 150 |
``` cpp
|
| 151 |
template <class Clock, class Duration1, class Duration2>
|
| 152 |
-
bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 153 |
```
|
| 154 |
|
| 155 |
*Returns:* `!(lhs == rhs)`.
|
| 156 |
|
| 157 |
``` cpp
|
| 158 |
template <class Clock, class Duration1, class Duration2>
|
| 159 |
-
bool operator<(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 160 |
```
|
| 161 |
|
| 162 |
*Returns:* `lhs.time_since_epoch() < rhs.time_since_epoch()`.
|
| 163 |
|
| 164 |
``` cpp
|
| 165 |
template <class Clock, class Duration1, class Duration2>
|
| 166 |
-
bool operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 167 |
```
|
| 168 |
|
| 169 |
*Returns:* `!(rhs < lhs)`.
|
| 170 |
|
| 171 |
``` cpp
|
| 172 |
template <class Clock, class Duration1, class Duration2>
|
| 173 |
-
bool operator>(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 174 |
```
|
| 175 |
|
| 176 |
*Returns:* `rhs < lhs`.
|
| 177 |
|
| 178 |
``` cpp
|
| 179 |
template <class Clock, class Duration1, class Duration2>
|
| 180 |
-
bool operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 181 |
```
|
| 182 |
|
| 183 |
*Returns:* `!(lhs < rhs)`.
|
| 184 |
|
| 185 |
#### `time_point_cast` <a id="time.point.cast">[[time.point.cast]]</a>
|
| 186 |
|
| 187 |
``` cpp
|
| 188 |
template <class ToDuration, class Clock, class Duration>
|
| 189 |
-
time_point<Clock, ToDuration>
|
|
|
|
| 190 |
```
|
| 191 |
|
| 192 |
*Remarks:* This function shall not participate in overload resolution
|
| 193 |
unless `ToDuration` is an instantiation of `duration`.
|
| 194 |
|
|
|
|
| 11 |
private:
|
| 12 |
duration d_; // exposition only
|
| 13 |
|
| 14 |
public:
|
| 15 |
// [time.point.cons], construct:
|
| 16 |
+
constexpr time_point(); // has value epoch
|
| 17 |
+
constexpr explicit time_point(const duration& d); // same as time_point() + d
|
| 18 |
template <class Duration2>
|
| 19 |
+
constexpr time_point(const time_point<clock, Duration2>& t);
|
| 20 |
|
| 21 |
// [time.point.observer], observer:
|
| 22 |
+
constexpr duration time_since_epoch() const;
|
| 23 |
|
| 24 |
// [time.point.arithmetic], arithmetic:
|
| 25 |
time_point& operator+=(const duration& d);
|
| 26 |
time_point& operator-=(const duration& d);
|
| 27 |
|
|
|
|
| 37 |
ill-formed.
|
| 38 |
|
| 39 |
#### `time_point` constructors <a id="time.point.cons">[[time.point.cons]]</a>
|
| 40 |
|
| 41 |
``` cpp
|
| 42 |
+
constexpr time_point();
|
| 43 |
```
|
| 44 |
|
| 45 |
*Effects:* Constructs an object of type `time_point`, initializing `d_`
|
| 46 |
with `duration::zero()`. Such a `time_point` object represents the
|
| 47 |
epoch.
|
| 48 |
|
| 49 |
``` cpp
|
| 50 |
+
constexpr explicit time_point(const duration& d);
|
| 51 |
```
|
| 52 |
|
| 53 |
*Effects:* Constructs an object of type `time_point`, initializing `d_`
|
| 54 |
with `d`. Such a `time_point` object represents the epoch `+ d`.
|
| 55 |
|
| 56 |
``` cpp
|
| 57 |
template <class Duration2>
|
| 58 |
+
constexpr time_point(const time_point<clock, Duration2>& t);
|
| 59 |
```
|
| 60 |
|
| 61 |
*Remarks:* This constructor shall not participate in overload resolution
|
| 62 |
unless `Duration2` is implicitly convertible to `duration`.
|
| 63 |
|
|
|
|
| 65 |
with `t.time_since_epoch()`.
|
| 66 |
|
| 67 |
#### `time_point` observer <a id="time.point.observer">[[time.point.observer]]</a>
|
| 68 |
|
| 69 |
``` cpp
|
| 70 |
+
constexpr duration time_since_epoch() const;
|
| 71 |
```
|
| 72 |
|
| 73 |
*Returns:* `d_`.
|
| 74 |
|
| 75 |
#### `time_point` arithmetic <a id="time.point.arithmetic">[[time.point.arithmetic]]</a>
|
|
|
|
| 106 |
|
| 107 |
#### `time_point` non-member arithmetic <a id="time.point.nonmember">[[time.point.nonmember]]</a>
|
| 108 |
|
| 109 |
``` cpp
|
| 110 |
template <class Clock, class Duration1, class Rep2, class Period2>
|
| 111 |
+
constexpr time_point<Clock, common_type_t<Duration1, duration<Rep2, Period2>>>
|
| 112 |
operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
|
| 113 |
```
|
| 114 |
|
| 115 |
+
*Returns:* `CT(lhs.time_since_epoch() + rhs)`, where `CT` is the type of
|
| 116 |
+
the return value.
|
| 117 |
|
| 118 |
``` cpp
|
| 119 |
template <class Rep1, class Period1, class Clock, class Duration2>
|
| 120 |
+
constexpr time_point<Clock, common_type_t<duration<Rep1, Period1>, Duration2>>
|
| 121 |
operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 122 |
```
|
| 123 |
|
| 124 |
*Returns:* `rhs + lhs`.
|
| 125 |
|
| 126 |
``` cpp
|
| 127 |
template <class Clock, class Duration1, class Rep2, class Period2>
|
| 128 |
+
constexpr time_point<Clock, common_type_t<Duration1, duration<Rep2, Period2>>>
|
| 129 |
operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
|
| 130 |
```
|
| 131 |
|
| 132 |
*Returns:* `lhs + (-rhs)`.
|
| 133 |
|
| 134 |
``` cpp
|
| 135 |
template <class Clock, class Duration1, class Duration2>
|
| 136 |
+
constexpr common_type_t<Duration1, Duration2>
|
| 137 |
operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 138 |
```
|
| 139 |
|
| 140 |
*Returns:* `lhs.time_since_epoch() - rhs.time_since_epoch()`.
|
| 141 |
|
| 142 |
#### `time_point` comparisons <a id="time.point.comparisons">[[time.point.comparisons]]</a>
|
| 143 |
|
| 144 |
``` cpp
|
| 145 |
template <class Clock, class Duration1, class Duration2>
|
| 146 |
+
constexpr bool operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 147 |
```
|
| 148 |
|
| 149 |
*Returns:* `lhs.time_since_epoch() == rhs.time_since_epoch()`.
|
| 150 |
|
| 151 |
``` cpp
|
| 152 |
template <class Clock, class Duration1, class Duration2>
|
| 153 |
+
constexpr bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 154 |
```
|
| 155 |
|
| 156 |
*Returns:* `!(lhs == rhs)`.
|
| 157 |
|
| 158 |
``` cpp
|
| 159 |
template <class Clock, class Duration1, class Duration2>
|
| 160 |
+
constexpr bool operator<(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 161 |
```
|
| 162 |
|
| 163 |
*Returns:* `lhs.time_since_epoch() < rhs.time_since_epoch()`.
|
| 164 |
|
| 165 |
``` cpp
|
| 166 |
template <class Clock, class Duration1, class Duration2>
|
| 167 |
+
constexpr bool operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 168 |
```
|
| 169 |
|
| 170 |
*Returns:* `!(rhs < lhs)`.
|
| 171 |
|
| 172 |
``` cpp
|
| 173 |
template <class Clock, class Duration1, class Duration2>
|
| 174 |
+
constexpr bool operator>(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 175 |
```
|
| 176 |
|
| 177 |
*Returns:* `rhs < lhs`.
|
| 178 |
|
| 179 |
``` cpp
|
| 180 |
template <class Clock, class Duration1, class Duration2>
|
| 181 |
+
constexpr bool operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
|
| 182 |
```
|
| 183 |
|
| 184 |
*Returns:* `!(lhs < rhs)`.
|
| 185 |
|
| 186 |
#### `time_point_cast` <a id="time.point.cast">[[time.point.cast]]</a>
|
| 187 |
|
| 188 |
``` cpp
|
| 189 |
template <class ToDuration, class Clock, class Duration>
|
| 190 |
+
constexpr time_point<Clock, ToDuration>
|
| 191 |
+
time_point_cast(const time_point<Clock, Duration>& t);
|
| 192 |
```
|
| 193 |
|
| 194 |
*Remarks:* This function shall not participate in overload resolution
|
| 195 |
unless `ToDuration` is an instantiation of `duration`.
|
| 196 |
|