|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
通用接口,同时具备可比较和可哈希功能 更多...
#include <icommon.hpp>
额外继承的成员函数 | |
| Public 成员函数 继承自 icomparable< T > | |
| constexpr bool | operator== (const T &rhs) const noexcept(noexcept(derived().equal_to(rhs))) |
| 相等比较运算符 | |
| constexpr bool | operator!= (const T &rhs) const noexcept(noexcept(!(derived().equal_to(rhs)))) |
| 不等比较运算符 | |
| constexpr bool | operator< (const T &rhs) const noexcept(noexcept(derived().less_than(rhs))) |
| 小于比较运算符 | |
| constexpr bool | operator> (const T &rhs) const noexcept(noexcept(rhs.less_than(derived()))) |
| 大于比较运算符 | |
| constexpr bool | operator<= (const T &rhs) const noexcept(noexcept(!(rhs.less_than(derived())))) |
| 小于等于比较运算符 | |
| constexpr bool | operator>= (const T &rhs) const noexcept(noexcept(!(derived().less_than(rhs)))) |
| 大于等于比较运算符 | |
| Public 成员函数 继承自 ihashable< T > | |
| constexpr size_t | to_ihash () const noexcept(noexcept(derived().to_hash())) |
| 获取对象的哈希值 | |
通用接口,同时具备可比较和可哈希功能
| T | 派生类类型 |
这是一个便利类,同时继承自icomparable和ihashable, 为派生类提供完整的比较和哈希支持。派生类需实现三个核心方法: equal_to(const T&), less_than(const T&) 和 to_hash()。
在文件 icommon.hpp 第 193 行定义.