tmp/tmpeg3p5ahz/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Overview <a id="time.clock.gps.overview">[[time.clock.gps.overview]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std::chrono {
|
| 5 |
+
class gps_clock {
|
| 6 |
+
public:
|
| 7 |
+
using rep = a signed arithmetic type;
|
| 8 |
+
using period = ratio<unspecified, unspecified>;
|
| 9 |
+
using duration = chrono::duration<rep, period>;
|
| 10 |
+
using time_point = chrono::time_point<gps_clock>;
|
| 11 |
+
static constexpr bool is_steady = unspecified;
|
| 12 |
+
|
| 13 |
+
static time_point now();
|
| 14 |
+
|
| 15 |
+
template<class Duration>
|
| 16 |
+
static utc_time<common_type_t<Duration, seconds>>
|
| 17 |
+
to_utc(const gps_time<Duration>&) noexcept;
|
| 18 |
+
template<class Duration>
|
| 19 |
+
static gps_time<common_type_t<Duration, seconds>>
|
| 20 |
+
from_utc(const utc_time<Duration>&) noexcept;
|
| 21 |
+
};
|
| 22 |
+
}
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
The clock `gps_clock` measures seconds since the first Sunday of
|
| 26 |
+
January, 1980 00:00:00 UTC. Leap seconds are not inserted into GPS.
|
| 27 |
+
Therefore every time a leap second is inserted into UTC, UTC shifts
|
| 28 |
+
another second with respect to GPS. Aside from the offset from
|
| 29 |
+
`1958y/January/1` to `1980y/January/Sunday[1]`, GPS is behind TAI by 19s
|
| 30 |
+
due to the 10s offset between 1958 and 1970 and the additional 9 leap
|
| 31 |
+
seconds inserted between 1970 and 1980.
|
| 32 |
+
|
| 33 |
+
`gps_clock` is not a *Cpp17TrivialClock* unless the implementation can
|
| 34 |
+
guarantee that `gps_clock::now()` does not propagate an exception.
|
| 35 |
+
|
| 36 |
+
[*Note 1*: `noexcept(from_utc(utc_clock::now()))` is
|
| 37 |
+
`false`. — *end note*]
|
| 38 |
+
|