|
|
constexpr | duration ()=default |
| | 默认构造函数
|
|
| duration (const duration &)=default |
| | 复制构造函数
|
|
constexpr duration & | operator= (const duration &)=default |
| | 复制赋值运算符
|
| template<typename Rep2, typename = enable_if_t<is_convertible_v<const Rep2&, rep>>> |
| constexpr | duration (const Rep2 &rep2) |
| | 从数值构造
|
| template<typename Rep2, typename Period2, typename Dummy = enable_if_t< is_convertible_v<const Rep2&, rep> && (is_floating_point_v<rep> || (is_harmonic<Period2>::value && !is_floating_point_v<Rep2>))>> |
| constexpr | duration (const duration< Rep2, Period2 > &dur) |
| | 从其他持续时间构造
|
| template<typename Clock, typename Dur, typename Dummy = enable_if_t<is_duration_v<Dur>>> |
| constexpr | duration (time_point< Clock, Dur > tp) |
| | 从其他时间点构造
|
| constexpr rep | count () const noexcept |
| | 获取计数值
|
| constexpr duration< common_type_t< rep >, period > | operator+ () const |
| | 一元正号运算符
|
| constexpr duration< common_type_t< rep >, period > | operator- () const |
| | 一元负号运算符
|
| constexpr duration & | operator++ () |
| | 前置自增运算符
|
| constexpr duration | operator++ (int) |
| | 后置自增运算符
|
| constexpr duration & | operator-- () |
| | 前置自减运算符
|
| constexpr duration | operator-- (int) |
| | 后置自减运算符
|
| constexpr duration & | operator+= (const duration &dur) |
| | 加法赋值运算符
|
| constexpr duration & | operator-= (const duration &dur) |
| | 减法赋值运算符
|
| constexpr duration & | operator*= (const rep &rhs) |
| | 乘法赋值运算符
|
| constexpr duration & | operator/= (const rep &rhs) |
| | 除法赋值运算符
|
| template<typename U = rep, enable_if_t<!is_floating_point_v< U >, int > = 0> |
| constexpr duration & | operator%= (const rep &rhs) |
| | 取模赋值运算符
|
| template<typename U = rep, enable_if_t<!is_floating_point_v< U >, int > = 0> |
| constexpr duration & | operator%= (const duration &rhs) |
| | 持续时间取模赋值运算符
|
template<typename Rep, typename Period>
class duration< Rep, Period >
持续时间类模板
- 模板参数
-
| Rep | 表示时间的数值类型 |
| Period | 时间单位比例 |
表示一个时间间隔,支持不同时间单位的转换和运算。
在文件 duration.hpp 第 179 行定义.
template<typename Rep, typename Period>
template<typename Rep2, typename Period2, typename Dummy = enable_if_t< is_convertible_v<const Rep2&, rep> && (is_floating_point_v<rep> || (is_harmonic<Period2>::value && !is_floating_point_v<Rep2>))>>
从其他持续时间构造
- 模板参数
-
| Rep2 | 源数值类型 |
| Period2 | 源时间单位比例 |
| Dummy | SFINAF参数 |
- 参数
-
从另一种持续时间类型构造,支持时间单位转换。
在文件 duration.hpp 第 249 行定义.