chrono::duration 下面的 typedef 是什么意思?
What does the following typedef mean in chrono::duration?
我在阅读 article 时遇到了一段代码,作者说 "the C++ standard library provides the following type definitions:"
namespace std {
namespace chrono {
typedef duration<signed int-type >= 64 bits,nano> nanoseconds;
typedef duration<signed int-type >= 55 bits,micro> microseconds;
typedef duration<signed int-type >= 45 bits,milli> milliseconds;
typedef duration<signed int-type >= 35 bits> seconds;
typedef duration<signed int-type >= 29 bits,ratio<60>> minutes;
typedef duration<signed int-type >= 23 bits,ratio<3600>> hours;
}
}
我的问题是 signed int-type >= 64 bits
是什么意思?这是否意味着 signed int
减去 type
?如果是这样,您如何解释?
这不是实际代码;它仅说明(以 "natural" 语言)在兼容实现中模板的类型参数需要什么。
因此 "signed int-type >= 64 bits" 表示 "any signed integer type with at least 64 bits",但字母较少。
我在阅读 article 时遇到了一段代码,作者说 "the C++ standard library provides the following type definitions:"
namespace std {
namespace chrono {
typedef duration<signed int-type >= 64 bits,nano> nanoseconds;
typedef duration<signed int-type >= 55 bits,micro> microseconds;
typedef duration<signed int-type >= 45 bits,milli> milliseconds;
typedef duration<signed int-type >= 35 bits> seconds;
typedef duration<signed int-type >= 29 bits,ratio<60>> minutes;
typedef duration<signed int-type >= 23 bits,ratio<3600>> hours;
}
}
我的问题是 signed int-type >= 64 bits
是什么意思?这是否意味着 signed int
减去 type
?如果是这样,您如何解释?
这不是实际代码;它仅说明(以 "natural" 语言)在兼容实现中模板的类型参数需要什么。
因此 "signed int-type >= 64 bits" 表示 "any signed integer type with at least 64 bits",但字母较少。