std::type_info:: before
From cppreference.net
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Type support
| Basic types | |||||||||||||||||||||
| Fixed width integer types (C++11) | |||||||||||||||||||||
| Fixed width floating-point types (C++23) | |||||||||||||||||||||
|
|||||||||||||||||||||
| Numeric limits | |||||||||||||||||||||
| C numeric limits interface | |||||||||||||||||||||
| Runtime type information | |||||||||||||||||||||
|
|||||||||||||||||||||
std::type_info
| Member functions | ||||
|
(until C++20)
|
||||
|
type_info::before
|
||||
|
(C++11)
|
||||
|
bool
before
(
const
type_info
&
rhs
)
const
;
|
(自 C++11 起为 noexcept) | |
如果此
type_info
的类型在实现定义的排序顺序中先于
rhs
的类型,则返回
true
。不提供任何保证;特别是排序顺序可能在同一个程序的不同调用之间发生变化。
目录 |
参数
| rhs | - | 要与之比较的另一个类型信息对象 |
返回值
若此
type_info
的类型在实现的有序排列中位于
rhs
的类型之前,则为
true
。
示例
运行此代码
可能的输出:
char goes before int in this implementation.
参见
|
(C++20 中移除)
|
检查对象是否引用相同类型
(公开成员函数) |