MSTL 1.4.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
time_point< Clock, Dur > 模板类 参考

时间点类模板 更多...

#include <time_point.hpp>

Public 类型

using clock_type = Clock
 时钟类型
using duration_type = Dur
 持续时间类型
using rep = typename duration_type::rep
 数值类型
using period = typename duration_type::period
 时间单位比例

Public 成员函数

constexpr time_point ()
 默认构造函数
constexpr time_point (const duration_type &dur)
 从持续时间构造
template<typename Dur2, typename = enable_if_t<is_convertible_v<Dur2, duration_type>>>
constexpr time_point (const time_point< clock_type, Dur2 > &value)
 从其他时间点构造
constexpr time_pointoperator++ ()
 前置自增运算符
constexpr time_point operator++ (int)
 后置自增运算符
constexpr time_pointoperator-- ()
 前置自减运算符
constexpr time_point operator-- (int)
 后置自减运算符
constexpr time_pointoperator+= (const duration_type &dur)
 加法赋值运算符
constexpr time_pointoperator-= (const duration_type &dur)
 减法赋值运算符
constexpr duration_type since_epoch () const noexcept
 获取自纪元以来的时间

静态 Public 成员函数

static constexpr time_point min () noexcept
 获取最小时间点
static constexpr time_point max () noexcept
 获取最大时间点

详细描述

template<typename Clock, typename Dur>
class time_point< Clock, Dur >

时间点类模板

模板参数
Clock时钟类型
Dur持续时间类型

表示特定时钟的一个时间点,支持时间算术运算和比较。

在文件 time_point.hpp85 行定义.

构造及析构函数说明

◆ time_point() [1/2]

template<typename Clock, typename Dur>
time_point< Clock, Dur >::time_point ( const duration_type & dur)
inlineexplicitconstexpr

从持续时间构造

参数
dur自纪元以来的持续时间

在文件 time_point.hpp106 行定义.

◆ time_point() [2/2]

template<typename Clock, typename Dur>
template<typename Dur2, typename = enable_if_t<is_convertible_v<Dur2, duration_type>>>
time_point< Clock, Dur >::time_point ( const time_point< clock_type, Dur2 > & value)
inlineconstexpr

从其他时间点构造

模板参数
Dur2源持续时间类型
参数
value源时间点

在文件 time_point.hpp114 行定义.

引用了 time_point().

成员函数说明

◆ max()

template<typename Clock, typename Dur>
constexpr time_point time_point< Clock, Dur >::max ( )
inlinestaticconstexprnoexcept

获取最大时间点

返回
最大时间点

在文件 time_point.hpp193 行定义.

引用了 time_point().

◆ min()

template<typename Clock, typename Dur>
constexpr time_point time_point< Clock, Dur >::min ( )
inlinestaticconstexprnoexcept

获取最小时间点

返回
最小时间点

在文件 time_point.hpp185 行定义.

引用了 time_point().

◆ operator++() [1/2]

template<typename Clock, typename Dur>
time_point & time_point< Clock, Dur >::operator++ ( )
inlineconstexpr

前置自增运算符

返回
自增后的时间点引用

在文件 time_point.hpp122 行定义.

引用了 time_point().

◆ operator++() [2/2]

template<typename Clock, typename Dur>
time_point time_point< Clock, Dur >::operator++ ( int )
inlineconstexpr

后置自增运算符

返回
自增前的时间点

在文件 time_point.hpp131 行定义.

引用了 time_point().

◆ operator+=()

template<typename Clock, typename Dur>
time_point & time_point< Clock, Dur >::operator+= ( const duration_type & dur)
inlineconstexpr

加法赋值运算符

参数
dur要加的持续时间
返回
当前对象的引用

在文件 time_point.hpp158 行定义.

引用了 time_point().

◆ operator--() [1/2]

template<typename Clock, typename Dur>
time_point & time_point< Clock, Dur >::operator-- ( )
inlineconstexpr

前置自减运算符

返回
自减后的时间点引用

在文件 time_point.hpp139 行定义.

引用了 time_point().

◆ operator--() [2/2]

template<typename Clock, typename Dur>
time_point time_point< Clock, Dur >::operator-- ( int )
inlineconstexpr

后置自减运算符

返回
自减前的时间点

在文件 time_point.hpp148 行定义.

引用了 time_point().

◆ operator-=()

template<typename Clock, typename Dur>
time_point & time_point< Clock, Dur >::operator-= ( const duration_type & dur)
inlineconstexpr

减法赋值运算符

参数
dur要减的持续时间
返回
当前对象的引用

在文件 time_point.hpp168 行定义.

引用了 time_point().

◆ since_epoch()

template<typename Clock, typename Dur>
duration_type time_point< Clock, Dur >::since_epoch ( ) const
inlineconstexprnoexcept

获取自纪元以来的时间

返回
自纪元以来的持续时间

在文件 time_point.hpp177 行定义.

被这些函数引用 operator+(), operator+(), operator-(), operator-(), operator<(), operator==() , 以及 time_cast().


该类的文档由以下文件生成: