1#ifndef MSTL_CORE_INTERFACE_ICOMMON_HPP__
2#define MSTL_CORE_INTERFACE_ICOMMON_HPP__
32 constexpr const T& derived()
const noexcept {
33 return static_cast<const T&
>(*this);
43 MSTL_NODISCARD
constexpr size_t to_hash() const
44 noexcept(noexcept(derived().
to_hash())) {
45 return derived().to_hash();
51 MSTL_NODISCARD
constexpr size_t operator ()(
const T& obj)
const
52 noexcept(
noexcept(obj.to_hash())) {
69 constexpr const T& derived()
const noexcept {
70 return static_cast<const T&
>(*this);
82 noexcept(
noexcept(derived() == rhs)) {
83 return derived() == rhs;
94 noexcept(
noexcept(!(*
this == rhs))) {
95 return !(*
this == rhs);
106 noexcept(
noexcept(derived() < rhs)) {
107 return derived() < rhs;
118 noexcept(
noexcept(rhs < derived())) {
119 return rhs < derived();
130 noexcept(
noexcept(!(derived() > rhs))) {
131 return !(derived() > rhs);
142 noexcept(
noexcept(!(derived() < rhs))) {
143 return !(derived() < rhs);
#define MSTL_END_NAMESPACE__
结束全局命名空间MSTL
#define MSTL_BEGIN_NAMESPACE__
开始全局命名空间MSTL
typename enable_if< Test, T >::type enable_if_t
enable_if的便捷别名
MSTL_NODISCARD constexpr bool operator==(const T &rhs) const noexcept(noexcept(derived()==rhs))
相等比较运算符
MSTL_NODISCARD constexpr bool operator!=(const T &rhs) const noexcept(noexcept(!(*this==rhs)))
不等比较运算符
MSTL_NODISCARD constexpr bool operator<=(const T &rhs) const noexcept(noexcept(!(derived() > rhs)))
小于等于比较运算符
MSTL_NODISCARD constexpr bool operator<(const T &rhs) const noexcept(noexcept(derived()< rhs))
小于比较运算符
MSTL_NODISCARD constexpr bool operator>=(const T &rhs) const noexcept(noexcept(!(derived()< rhs)))
大于等于比较运算符
MSTL_NODISCARD constexpr bool operator>(const T &rhs) const noexcept(noexcept(rhs< derived()))
大于比较运算符
MSTL_NODISCARD constexpr size_t to_hash() const noexcept(noexcept(derived().to_hash()))
获取对象的哈希值