C++ 概念: EqualityComparable

来自cppreference.com
< cpp‎ | concept

 
 
C++ 的概念

|- class="t-nv-h1" | colspan="5" | 基础 |- | |- |

DefaultConstructible
CopyAssignable
CopyConstructible

|

|-

|- class="t-nv-h1" | colspan="5" | 库 |- | |- |

EqualityComparable
LessThanComparable
Swappable(C++11)
ValueSwappable(C++11)

|

NullablePointer(C++11)
Hash(C++11)
Allocator

|-

|- class="t-nv-h1" | colspan="5" | 容器 |- | |- |

|

|-

容器元素

| |- |

CopyInsertable(C++11)
MoveInsertable(C++11)

|

|-

|- class="t-nv-h1" | colspan="5" | 迭代器 |- | |- |

|

|-

|- class="t-nv-h1" | colspan="5" | 随机数 |- | |- |

SeedSequence(C++11)
RandomNumberEngine(C++11)

|

|-

|- class="t-nv-h1" | colspan="5" | 并发 |- | |- |

BasicLockable(C++11)
Lockable(C++11)
TimedLockable(C++11)

|

Mutex(C++11)
TimedMutex(C++11)

|-

|- class="t-nv-h1" | colspan="5" | 其它 |- | |- |

|

UnaryTypeTrait(C++11)
BinaryTypeTrait(C++11)
TransformationTrait(C++11)
TrivialClock(C++11)

|-

 

The type must work with == operator and the result should have standard semantics.


[编辑] 要求

Expression Requirements Return type
a == b
  • Commutativity (a == b yields the same as b == a)
  • Transitivity (if a == b and b == c, then a == c)
bool or a type implicitly convertible to bool