Console Library 4.7.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
literals.h File Reference

提供自定义字面量运算符,包括字符串字面量、时间字面量和格式化字符串字面量。 More...

#include "strpp.h"
#include "time.h"

Go to the source code of this file.

Namespaces

namespace  console::literals
 包含自定义字面量运算符的命名空间。
namespace  console
 本库所有组件所在的顶层命名空间。

Functions

Time console::literals::operator""_ns (unsigned long long ns)
 纳秒字面量(整数)。
Time console::literals::operator""_us (unsigned long long us)
 微秒字面量(整数)。
Time console::literals::operator""_ms (unsigned long long ms)
 毫秒字面量(整数)。
Time console::literals::operator""_s (unsigned long long s)
 秒字面量(整数)。
Time console::literals::operator""_min (unsigned long long min)
 分钟字面量(整数)。
Time console::literals::operator""_hr (unsigned long long hr)
 小时字面量(整数)。
Time console::literals::operator""_ns (long double ns)
 纳秒字面量(浮点数)。
Time console::literals::operator""_us (long double us)
 微秒字面量(浮点数)。
Time console::literals::operator""_ms (long double ms)
 毫秒字面量(浮点数)。
Time console::literals::operator""_s (long double s)
 秒字面量(浮点数)。
Time console::literals::operator""_min (long double min)
 分钟字面量(浮点数)。
Time console::literals::operator""_hr (long double hr)
 小时字面量(浮点数)。
f_string console::literals::operator""_f (const char *str, size_t)
 格式化字符串字面量,返回 f_string 对象,支持延迟格式化。

Detailed Description

提供自定义字面量运算符,包括字符串字面量、时间字面量和格式化字符串字面量。

提供纳秒、微秒、毫秒、秒、分钟、小时的 _ns_us_ms_s_min_hr 后缀; 以及用于格式化字符串的 _f 后缀。

Author
MrXie1109
Date
2026