|
|
constexpr | time () noexcept=default |
| | 默认构造函数,创建00:00:00
|
|
NEFORCE_CONSTEXPR20 | ~time ()=default |
| | 析构函数
|
| constexpr | time (const time_type hour, const time_type minute, const time_type second) noexcept |
| | 构造函数
|
| NEFORCE_NODISCARD constexpr time_type | hours () const noexcept |
| | 获取小时
|
| NEFORCE_NODISCARD constexpr time_type | minutes () const noexcept |
| | 获取分钟
|
| NEFORCE_NODISCARD constexpr time_type | seconds () const noexcept |
| | 获取秒
|
| constexpr bool | is_valid () const noexcept |
| | 检查时间是否有效
|
|
constexpr void | clear () noexcept |
| | 重置为00:00:00
|
| NEFORCE_NODISCARD constexpr time_type | to_seconds () const noexcept |
| | 转换为总秒数
|
|
constexpr bool | operator== (const time &other) const noexcept |
| | 相等比较
|
|
constexpr bool | operator< (const time &other) const noexcept |
| | 小于比较
|
| constexpr time & | operator+= (const time_type seconds) |
| | 时间加秒数
|
| constexpr time & | operator-= (const time_type seconds) noexcept |
| | 时间减秒数
|
| constexpr time | operator+ (const time_type seconds) const noexcept |
| | 时间加秒数
|
| constexpr time | operator- (const time_type seconds) const noexcept |
| | 时间减秒数
|
|
constexpr time & | operator++ () |
| | 前置递增(加1秒)
|
|
constexpr time | operator++ (int) |
| | 后置递增(加1秒)
|
|
constexpr time & | operator-- () |
| | 前置递减(减1秒)
|
|
constexpr time | operator-- (int) |
| | 后置递减(减1秒)
|
| constexpr time_type | operator- (const time &other) const noexcept |
| | 时间差(秒数)
|
| NEFORCE_NODISCARD constexpr size_t | to_hash () const noexcept |
| | 计算哈希值
|
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string () const |
| | 转换为字符串
|
| constexpr void | swap (time &other) noexcept |
| | 交换两个时间
|
| NEFORCE_CONSTEXPR20 bool | try_parse (const string_view str) noexcept |
| | 尝试从字符串解析对象
|
| NEFORCE_NODISCARD NEFORCE_CONSTEXPR20 string | to_string () const |
| | 转换为字符串
|
| NEFORCE_NODISCARD constexpr bool | operator== (const time &rhs) const noexcept(noexcept(derived()==rhs)) |
| | 相等比较运算符
|
| NEFORCE_NODISCARD constexpr bool | operator!= (const time &rhs) const noexcept(noexcept(!(*this==rhs))) |
| | 不等比较运算符
|
| NEFORCE_NODISCARD constexpr bool | operator< (const time &rhs) const noexcept(noexcept(derived()< rhs)) |
| | 小于比较运算符
|
| NEFORCE_NODISCARD constexpr bool | operator> (const time &rhs) const noexcept(noexcept(rhs< derived())) |
| | 大于比较运算符
|
| NEFORCE_NODISCARD constexpr bool | operator<= (const time &rhs) const noexcept(noexcept(!(derived() > rhs))) |
| | 小于等于比较运算符
|
| NEFORCE_NODISCARD constexpr bool | operator>= (const time &rhs) const noexcept(noexcept(!(derived()< rhs))) |
| | 大于等于比较运算符
|
| NEFORCE_NODISCARD constexpr size_t | to_hash () const noexcept(noexcept(derived().to_hash())) |
| | 获取对象的哈希值
|
时间类
表示一天中的时间(时、分、秒),支持时间间隔计算。
在文件 datetime.hpp 第 454 行定义.