|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
可比较对象接口模板 更多...
#include <icommon.hpp>
Public 成员函数 | |
| 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)))) |
| 大于等于比较运算符 | |
可比较对象接口模板
| T | 派生类类型 |
通过CRTP模式实现,派生类只需实现 equal_to(const T&) 和 less_than(const T&) 两个基本比较操作, 即可自动获得所有比较运算符的完整实现。
在文件 icommon.hpp 第 80 行定义.
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |