Namespaces
Variants

std::chrono:: hh_mm_ss

From cppreference.net
定义于头文件 <chrono>
template < class Duration >
class hh_mm_ss ;
(C++20 起)

类模板 hh_mm_ss std::chrono::duration 拆分为“分解后”的时间格式,例如 小时 : 分钟 : ,其拆分精度由 Duration 模板参数决定。它主要是一个格式化工具。

Duration 必须是 std::chrono::duration 的特化类型,否则程序非良构。

目录

成员常量

constexpr unsigned fractional_width
[static]
范围 [ 0 , 18 ] 内满足 precision (见下文)能精确表示 Duration { 1 } 值的最小整数,若无此整数则为 6
(公开静态成员常量)

成员类型

成员类型 定义
precision

std:: chrono :: duration < std:: common_type_t < Duration :: rep , std :: chrono :: seconds :: rep > , std:: ratio < 1 , 10 fractional_width >>

成员函数

构造 hh_mm_ss 对象
(公开成员函数)
获取分解时间的组成部分
(公开成员函数)
获取存储的 std::chrono::duration
(公开成员函数)

非成员函数

(C++20)
hh_mm_ss 输出到流中
(函数模板)

辅助类

hh_mm_ss 的格式化支持
(类模板特化)