|
| template<typename ToDur, typename Rep, typename Period, enable_if_t< is_duration< ToDur >::value, int > = 0> |
| constexpr ToDur | neforce::time_cast (const duration< Rep, Period > &value) |
| | 持续时间类型转换
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr common_type_t< duration< Rep1, Period1 >, duration< Rep2, Period2 > > | neforce::operator+ (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 加法运算符
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr common_type_t< duration< Rep1, Period1 >, duration< Rep2, Period2 > > | neforce::operator- (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 减法运算符
|
| template<typename Rep1, typename Period, typename Rep2> |
| constexpr duration< inner::__common_rep_t< Rep1, Rep2 >, Period > | neforce::operator* (const duration< Rep1, Period > &value, const Rep2 &scalar) |
| | 乘法运算符(持续时间 * 标量)
|
| template<typename Rep1, typename Rep2, typename Period> |
| constexpr duration< inner::__common_rep_t< Rep2, Rep1 >, Period > | neforce::operator* (const Rep1 &scalar, const duration< Rep2, Period > &value) |
| | 乘法运算符(标量 * 持续时间)
|
| template<typename Rep1, typename Period, typename Rep2> |
| constexpr duration< inner::__common_rep_t< Rep1, enable_if_t<!is_duration_v< Rep2 >, Rep2 > >, Period > | neforce::operator/ (const duration< Rep1, Period > &value, const Rep2 &scalar) |
| | 除法运算符(持续时间 / 标量)
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr common_type_t< Rep1, Rep2 > | neforce::operator/ (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 除法运算符(持续时间 / 持续时间)
|
| template<typename Rep1, typename Period, typename Rep2> |
| constexpr duration< inner::__common_rep_t< Rep1, enable_if_t<!is_duration_v< Rep2 >, Rep2 > >, Period > | neforce::operator% (const duration< Rep1, Period > &value, const Rep2 &scalar) |
| | 取模运算符(持续时间 % 标量)
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr common_type_t< duration< Rep1, Period1 >, duration< Rep2, Period2 > > | neforce::operator% (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 取模运算符(持续时间 % 持续时间)
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr bool | neforce::operator== (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 等于比较运算符
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr bool | neforce::operator!= (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 不等于比较运算符
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr bool | neforce::operator< (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 小于比较运算符
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr bool | neforce::operator<= (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 小于等于比较运算符
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr bool | neforce::operator> (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 大于比较运算符
|
| template<typename Rep1, typename Period1, typename Rep2, typename Period2> |
| constexpr bool | neforce::operator>= (const duration< Rep1, Period1 > &lhs, const duration< Rep2, Period2 > &rhs) |
| | 大于等于比较运算符
|
| template<typename ToDur, typename Rep, typename Period> |
| constexpr enable_if_t< is_duration_v< ToDur >, ToDur > | neforce::floor (const duration< Rep, Period > &dur) |
| | 向下取整持续时间转换
|
| template<typename ToDur, typename Rep, typename Period> |
| constexpr enable_if_t< is_duration_v< ToDur >, ToDur > | neforce::ceil (const duration< Rep, Period > &dur) |
| | 向上取整持续时间转换
|
| constexpr duration< decimal_t, ratio< 3600, 1 > > | neforce::operator""_h (const decimal_t hours) noexcept |
| | 小时字面量(浮点版本)
|
| template<char... Digits> |
| constexpr hours | neforce::operator""_h () noexcept |
| | 小时字面量(整型版本)
|
| constexpr duration< decimal_t, ratio< 60, 1 > > | neforce::operator""_min (const decimal_t mins) noexcept |
| | 分钟字面量(浮点版本)
|
| template<char... Digits> |
| constexpr minutes | neforce::operator""_min () noexcept |
| | 分钟字面量(整型版本)
|
| constexpr duration< decimal_t > | neforce::operator""_s (const decimal_t secs) noexcept |
| | 秒字面量(浮点版本)
|
| template<char... Digits> |
| constexpr seconds | neforce::operator""_s () noexcept |
| | 秒字面量(整型版本)
|
| constexpr duration< decimal_t, milli > | neforce::operator""_ms (const decimal_t msecs) noexcept |
| | 毫秒字面量(浮点版本)
|
| template<char... Digits> |
| constexpr milliseconds | neforce::operator""_ms () noexcept |
| | 毫秒字面量(整型版本)
|
| constexpr duration< decimal_t, micro > | neforce::operator""_us (const decimal_t usecs) noexcept |
| | 微秒字面量(浮点版本)
|
| template<char... Digits> |
| constexpr microseconds | neforce::operator""_us () noexcept |
| | 微秒字面量(整型版本)
|
| constexpr duration< decimal_t, nano > | neforce::operator""_ns (const decimal_t nsecs) noexcept |
| | 纳秒字面量(浮点版本)
|
| template<char... Digits> |
| constexpr nanoseconds | neforce::operator""_ns () noexcept |
| | 纳秒字面量(整型版本)
|
| template<typename Rep, typename Period> |
| void | neforce::this_thread::sleep_for (const duration< Rep, Period > time) |
| | 使当前线程睡眠指定时间
|
持续时间类型
此文件提供了持续时间类型及相关操作,支持不同时间单位的表示和转换。
在文件 duration.hpp 中定义.