tmp/tmpxugy129i/{from.md → to.md}
RENAMED
|
@@ -1,39 +1,42 @@
|
|
| 1 |
### Header `<chrono>` synopsis <a id="time.syn">[[time.syn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
namespace chrono {
|
| 6 |
-
|
| 7 |
// [time.duration], class template duration
|
| 8 |
template <class Rep, class Period = ratio<1>> class duration;
|
| 9 |
|
| 10 |
// [time.point], class template time_point
|
| 11 |
template <class Clock, class Duration = typename Clock::duration> class time_point;
|
|
|
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
// [time.traits.specializations] common_type specializations
|
| 16 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
template <class Clock, class Duration1, class Duration2>
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
namespace chrono {
|
| 23 |
-
|
| 24 |
// [time.traits], customization traits
|
| 25 |
template <class Rep> struct treat_as_floating_point;
|
| 26 |
template <class Rep> struct duration_values;
|
|
|
|
|
|
|
| 27 |
|
| 28 |
// [time.duration.nonmember], duration arithmetic
|
| 29 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 30 |
common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>>
|
| 31 |
-
|
|
|
|
| 32 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 33 |
common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>>
|
| 34 |
-
|
|
|
|
| 35 |
template <class Rep1, class Period, class Rep2>
|
| 36 |
duration<common_type_t<Rep1, Rep2>, Period>
|
| 37 |
constexpr operator*(const duration<Rep1, Period>& d, const Rep2& s);
|
| 38 |
template <class Rep1, class Rep2, class Period>
|
| 39 |
duration<common_type_t<Rep1, Rep2>, Period>
|
|
@@ -41,17 +44,19 @@ template <class Rep1, class Rep2, class Period>
|
|
| 41 |
template <class Rep1, class Period, class Rep2>
|
| 42 |
duration<common_type_t<Rep1, Rep2>, Period>
|
| 43 |
constexpr operator/(const duration<Rep1, Period>& d, const Rep2& s);
|
| 44 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 45 |
common_type_t<Rep1, Rep2>
|
| 46 |
-
|
|
|
|
| 47 |
template <class Rep1, class Period, class Rep2>
|
| 48 |
duration<common_type_t<Rep1, Rep2>, Period>
|
| 49 |
constexpr operator%(const duration<Rep1, Period>& d, const Rep2& s);
|
| 50 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 51 |
common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>>
|
| 52 |
-
|
|
|
|
| 53 |
|
| 54 |
// [time.duration.comparisons], duration comparisons
|
| 55 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 56 |
constexpr bool operator==(const duration<Rep1, Period1>& lhs,
|
| 57 |
const duration<Rep2, Period2>& rhs);
|
|
@@ -72,34 +77,44 @@ template <class Rep1, class Period1, class Rep2, class Period2>
|
|
| 72 |
const duration<Rep2, Period2>& rhs);
|
| 73 |
|
| 74 |
// [time.duration.cast], duration_cast
|
| 75 |
template <class ToDuration, class Rep, class Period>
|
| 76 |
constexpr ToDuration duration_cast(const duration<Rep, Period>& d);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
// convenience typedefs
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
|
| 86 |
// [time.point.nonmember], time_point arithmetic
|
| 87 |
template <class Clock, class Duration1, class Rep2, class Period2>
|
| 88 |
constexpr time_point<Clock, common_type_t<Duration1, duration<Rep2, Period2>>>
|
| 89 |
-
|
|
|
|
| 90 |
template <class Rep1, class Period1, class Clock, class Duration2>
|
| 91 |
constexpr time_point<Clock, common_type_t<duration<Rep1, Period1>, Duration2>>
|
| 92 |
-
|
|
|
|
| 93 |
template <class Clock, class Duration1, class Rep2, class Period2>
|
| 94 |
constexpr time_point<Clock, common_type_t<Duration1, duration<Rep2, Period2>>>
|
| 95 |
-
|
|
|
|
| 96 |
template <class Clock, class Duration1, class Duration2>
|
| 97 |
constexpr common_type_t<Duration1, Duration2>
|
| 98 |
-
|
|
|
|
| 99 |
|
| 100 |
-
// [time.point.comparisons] time_point comparisons
|
| 101 |
template <class Clock, class Duration1, class Duration2>
|
| 102 |
constexpr bool operator==(const time_point<Clock, Duration1>& lhs,
|
| 103 |
const time_point<Clock, Duration2>& rhs);
|
| 104 |
template <class Clock, class Duration1, class Duration2>
|
| 105 |
constexpr bool operator!=(const time_point<Clock, Duration1>& lhs,
|
|
@@ -119,22 +134,33 @@ template <class Clock, class Duration1, class Duration2>
|
|
| 119 |
|
| 120 |
// [time.point.cast], time_point_cast
|
| 121 |
template <class ToDuration, class Clock, class Duration>
|
| 122 |
constexpr time_point<Clock, ToDuration>
|
| 123 |
time_point_cast(const time_point<Clock, Duration>& t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
// [time.clock], clocks
|
| 126 |
class system_clock;
|
| 127 |
class steady_clock;
|
| 128 |
class high_resolution_clock;
|
| 129 |
-
|
| 130 |
-
} // namespace chrono
|
| 131 |
|
| 132 |
inline namespace literals {
|
| 133 |
inline namespace chrono_literals {
|
| 134 |
-
|
| 135 |
-
// ~[time.duration.literals], suffixes for duration literals
|
| 136 |
constexpr chrono::hours operator""h(unsigned long long);
|
| 137 |
constexpr chrono::duration<unspecified, ratio<3600,1>> operator""h(long double);
|
| 138 |
constexpr chrono::minutes operator""min(unsigned long long);
|
| 139 |
constexpr chrono::duration<unspecified, ratio<60,1>> operator""min(long double);
|
| 140 |
constexpr chrono::seconds operator""s(unsigned long long);
|
|
@@ -143,18 +169,14 @@ constexpr chrono::milliseconds operator "" ms(unsigned
|
|
| 143 |
constexpr chrono::duration<unspecified, milli> operator""ms(long double);
|
| 144 |
constexpr chrono::microseconds operator""us(unsigned long long);
|
| 145 |
constexpr chrono::duration<unspecified, micro> operator""us(long double);
|
| 146 |
constexpr chrono::nanoseconds operator""ns(unsigned long long);
|
| 147 |
constexpr chrono::duration<unspecified, nano> operator""ns(long double);
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
} // namespace literals
|
| 151 |
|
| 152 |
namespace chrono {
|
| 153 |
-
|
| 154 |
using namespace literals::chrono_literals;
|
| 155 |
-
|
| 156 |
-
}
|
| 157 |
-
|
| 158 |
-
} // namespace std
|
| 159 |
```
|
| 160 |
|
|
|
|
| 1 |
### Header `<chrono>` synopsis <a id="time.syn">[[time.syn]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
namespace chrono {
|
|
|
|
| 6 |
// [time.duration], class template duration
|
| 7 |
template <class Rep, class Period = ratio<1>> class duration;
|
| 8 |
|
| 9 |
// [time.point], class template time_point
|
| 10 |
template <class Clock, class Duration = typename Clock::duration> class time_point;
|
| 11 |
+
}
|
| 12 |
|
| 13 |
+
// [time.traits.specializations], common_type specializations
|
|
|
|
|
|
|
| 14 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 15 |
+
struct common_type<chrono::duration<Rep1, Period1>,
|
| 16 |
+
chrono::duration<Rep2, Period2>>;
|
| 17 |
|
| 18 |
template <class Clock, class Duration1, class Duration2>
|
| 19 |
+
struct common_type<chrono::time_point<Clock, Duration1>,
|
| 20 |
+
chrono::time_point<Clock, Duration2>>;
|
| 21 |
|
| 22 |
namespace chrono {
|
|
|
|
| 23 |
// [time.traits], customization traits
|
| 24 |
template <class Rep> struct treat_as_floating_point;
|
| 25 |
template <class Rep> struct duration_values;
|
| 26 |
+
template <class Rep> inline constexpr bool treat_as_floating_point_v
|
| 27 |
+
= treat_as_floating_point<Rep>::value;
|
| 28 |
|
| 29 |
// [time.duration.nonmember], duration arithmetic
|
| 30 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 31 |
common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>>
|
| 32 |
+
constexpr operator+(const duration<Rep1, Period1>& lhs,
|
| 33 |
+
const duration<Rep2, Period2>& rhs);
|
| 34 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 35 |
common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>>
|
| 36 |
+
constexpr operator-(const duration<Rep1, Period1>& lhs,
|
| 37 |
+
const duration<Rep2, Period2>& rhs);
|
| 38 |
template <class Rep1, class Period, class Rep2>
|
| 39 |
duration<common_type_t<Rep1, Rep2>, Period>
|
| 40 |
constexpr operator*(const duration<Rep1, Period>& d, const Rep2& s);
|
| 41 |
template <class Rep1, class Rep2, class Period>
|
| 42 |
duration<common_type_t<Rep1, Rep2>, Period>
|
|
|
|
| 44 |
template <class Rep1, class Period, class Rep2>
|
| 45 |
duration<common_type_t<Rep1, Rep2>, Period>
|
| 46 |
constexpr operator/(const duration<Rep1, Period>& d, const Rep2& s);
|
| 47 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 48 |
common_type_t<Rep1, Rep2>
|
| 49 |
+
constexpr operator/(const duration<Rep1, Period1>& lhs,
|
| 50 |
+
const duration<Rep2, Period2>& rhs);
|
| 51 |
template <class Rep1, class Period, class Rep2>
|
| 52 |
duration<common_type_t<Rep1, Rep2>, Period>
|
| 53 |
constexpr operator%(const duration<Rep1, Period>& d, const Rep2& s);
|
| 54 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 55 |
common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>>
|
| 56 |
+
constexpr operator%(const duration<Rep1, Period1>& lhs,
|
| 57 |
+
const duration<Rep2, Period2>& rhs);
|
| 58 |
|
| 59 |
// [time.duration.comparisons], duration comparisons
|
| 60 |
template <class Rep1, class Period1, class Rep2, class Period2>
|
| 61 |
constexpr bool operator==(const duration<Rep1, Period1>& lhs,
|
| 62 |
const duration<Rep2, Period2>& rhs);
|
|
|
|
| 77 |
const duration<Rep2, Period2>& rhs);
|
| 78 |
|
| 79 |
// [time.duration.cast], duration_cast
|
| 80 |
template <class ToDuration, class Rep, class Period>
|
| 81 |
constexpr ToDuration duration_cast(const duration<Rep, Period>& d);
|
| 82 |
+
template <class ToDuration, class Rep, class Period>
|
| 83 |
+
constexpr ToDuration floor(const duration<Rep, Period>& d);
|
| 84 |
+
template <class ToDuration, class Rep, class Period>
|
| 85 |
+
constexpr ToDuration ceil(const duration<Rep, Period>& d);
|
| 86 |
+
template <class ToDuration, class Rep, class Period>
|
| 87 |
+
constexpr ToDuration round(const duration<Rep, Period>& d);
|
| 88 |
|
| 89 |
// convenience typedefs
|
| 90 |
+
using nanoseconds = duration<signed integer type of at least 64 bits, nano>;
|
| 91 |
+
using microseconds = duration<signed integer type of at least 55 bits, micro>;
|
| 92 |
+
using milliseconds = duration<signed integer type of at least 45 bits, milli>;
|
| 93 |
+
using seconds = duration<signed integer type of at least 35 bits>;
|
| 94 |
+
using minutes = duration<signed integer type of at least 29 bits, ratio< 60>>;
|
| 95 |
+
using hours = duration<signed integer type of at least 23 bits, ratio<3600>>;
|
| 96 |
|
| 97 |
// [time.point.nonmember], time_point arithmetic
|
| 98 |
template <class Clock, class Duration1, class Rep2, class Period2>
|
| 99 |
constexpr time_point<Clock, common_type_t<Duration1, duration<Rep2, Period2>>>
|
| 100 |
+
operator+(const time_point<Clock, Duration1>& lhs,
|
| 101 |
+
const duration<Rep2, Period2>& rhs);
|
| 102 |
template <class Rep1, class Period1, class Clock, class Duration2>
|
| 103 |
constexpr time_point<Clock, common_type_t<duration<Rep1, Period1>, Duration2>>
|
| 104 |
+
operator+(const duration<Rep1, Period1>& lhs,
|
| 105 |
+
const time_point<Clock, Duration2>& rhs);
|
| 106 |
template <class Clock, class Duration1, class Rep2, class Period2>
|
| 107 |
constexpr time_point<Clock, common_type_t<Duration1, duration<Rep2, Period2>>>
|
| 108 |
+
operator-(const time_point<Clock, Duration1>& lhs,
|
| 109 |
+
const duration<Rep2, Period2>& rhs);
|
| 110 |
template <class Clock, class Duration1, class Duration2>
|
| 111 |
constexpr common_type_t<Duration1, Duration2>
|
| 112 |
+
operator-(const time_point<Clock, Duration1>& lhs,
|
| 113 |
+
const time_point<Clock, Duration2>& rhs);
|
| 114 |
|
| 115 |
+
// [time.point.comparisons], time_point comparisons
|
| 116 |
template <class Clock, class Duration1, class Duration2>
|
| 117 |
constexpr bool operator==(const time_point<Clock, Duration1>& lhs,
|
| 118 |
const time_point<Clock, Duration2>& rhs);
|
| 119 |
template <class Clock, class Duration1, class Duration2>
|
| 120 |
constexpr bool operator!=(const time_point<Clock, Duration1>& lhs,
|
|
|
|
| 134 |
|
| 135 |
// [time.point.cast], time_point_cast
|
| 136 |
template <class ToDuration, class Clock, class Duration>
|
| 137 |
constexpr time_point<Clock, ToDuration>
|
| 138 |
time_point_cast(const time_point<Clock, Duration>& t);
|
| 139 |
+
template <class ToDuration, class Clock, class Duration>
|
| 140 |
+
constexpr time_point<Clock, ToDuration>
|
| 141 |
+
floor(const time_point<Clock, Duration>& tp);
|
| 142 |
+
template <class ToDuration, class Clock, class Duration>
|
| 143 |
+
constexpr time_point<Clock, ToDuration>
|
| 144 |
+
ceil(const time_point<Clock, Duration>& tp);
|
| 145 |
+
template <class ToDuration, class Clock, class Duration>
|
| 146 |
+
constexpr time_point<Clock, ToDuration>
|
| 147 |
+
round(const time_point<Clock, Duration>& tp);
|
| 148 |
+
|
| 149 |
+
// [time.duration.alg], specialized algorithms
|
| 150 |
+
template <class Rep, class Period>
|
| 151 |
+
constexpr duration<Rep, Period> abs(duration<Rep, Period> d);
|
| 152 |
|
| 153 |
// [time.clock], clocks
|
| 154 |
class system_clock;
|
| 155 |
class steady_clock;
|
| 156 |
class high_resolution_clock;
|
| 157 |
+
}
|
|
|
|
| 158 |
|
| 159 |
inline namespace literals {
|
| 160 |
inline namespace chrono_literals {
|
| 161 |
+
// [time.duration.literals], suffixes for duration literals
|
|
|
|
| 162 |
constexpr chrono::hours operator""h(unsigned long long);
|
| 163 |
constexpr chrono::duration<unspecified, ratio<3600,1>> operator""h(long double);
|
| 164 |
constexpr chrono::minutes operator""min(unsigned long long);
|
| 165 |
constexpr chrono::duration<unspecified, ratio<60,1>> operator""min(long double);
|
| 166 |
constexpr chrono::seconds operator""s(unsigned long long);
|
|
|
|
| 169 |
constexpr chrono::duration<unspecified, milli> operator""ms(long double);
|
| 170 |
constexpr chrono::microseconds operator""us(unsigned long long);
|
| 171 |
constexpr chrono::duration<unspecified, micro> operator""us(long double);
|
| 172 |
constexpr chrono::nanoseconds operator""ns(unsigned long long);
|
| 173 |
constexpr chrono::duration<unspecified, nano> operator""ns(long double);
|
| 174 |
+
}
|
| 175 |
+
}
|
|
|
|
| 176 |
|
| 177 |
namespace chrono {
|
|
|
|
| 178 |
using namespace literals::chrono_literals;
|
| 179 |
+
}
|
| 180 |
+
}
|
|
|
|
|
|
|
| 181 |
```
|
| 182 |
|