c++ - std::type_index 的 less 是如何实现的?

标签 c++ c++14

std::type_index 有一个小于运算符,应该使用 std::type_infostd::type_info 没有小于运算符。

那么std::type_index怎么会有小于运算符呢?

https://en.cppreference.com/w/cpp/types/type_index

最佳答案

documentation for the comparison operator状态:

Compares the underlying std::type_info objects as defined by an implementation-defined ordering. The comparison is done by type_info::before.

关于c++ - std::type_index 的 less 是如何实现的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59775541/

相关文章:

c++ - 我如何返回包装容器的反向适配器?

c++ - "CoInitialize failed"当一个函数(来自库)包含在 VC++ MFC 项目中时

c++ - 使用不同功能的队列中的打印元素不会在_start程序中全局清空队列。还有更多解释吗?

c++ - 自定义元素的迭代器在 vector 中

c++ - 使用 C++ 中的现有类进行代码重构

c++ - 在多行文本编辑控件中自动显示垂直滚动条

c# - Direct2D 模糊渲染

c++ - 模板概念是否达到了 c++14?

c++ - 仅使用 bool 和 char 定义模板类

c++ - 指向类成员的指针作为模板参数