(C++17) | ||||
| Sequence | ||||
(C++11) | ||||
(C++26) | ||||
(C++26) | ||||
(C++11) | ||||
| Associative | ||||
| Unordered associative | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
| Adaptors | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
| Views | ||||
(C++20) | ||||
(C++23) | ||||
| Tables | ||||
| Iterator invalidation | ||||
| Member function table | ||||
| Non-member function table |
constexprfriendbool operator==(conststd::inplace_vector<T, N>& lhs, conststd::inplace_vector<T, N>& rhs); | (1) | (since C++26) |
constexprfriend synth-three-way-result<T> operator<=>(conststd::inplace_vector<T, N>& lhs, | (2) | (since C++26) |
Compares the contents of twostd::inplace_vectors.
T modelsthree_way_comparable.< is defined for values of type (possibly const-qualified)T, and< is a total ordering relationship.The<,<=,>,>=, and!= operators aresynthesized fromoperator<=> andoperator== respectively.
Contents |
| lhs, rhs | - | std::inplace_vectors whose contents to compare |
-T must meet the requirements ofEqualityComparable in order to use overloads (1). | ||
The relational operators are defined in terms ofsynth-three-way, which usesoperator<=> if possible, oroperator< otherwise.
Notably, if the element does not itself provideoperator<=>, but is implicitly convertible to a three-way comparable type, that conversion will be used instead ofoperator<.
#include <inplace_vector> int main(){constexprstd::inplace_vector<int,4> a{1,2,3}, b{1,2,3}, c{7,8,9,10}; static_assert("""Compare equal containers:"&&(a!= b)==false&&(a== b)==true&&(a< b)==false&&(a<= b)==true&&(a> b)==false&&(a>= b)==true&&(a<=> b)>=0&&(a<=> b)<=0&&(a<=> b)==0&& "Compare non equal containers:"&&(a!= c)==true&&(a== c)==false&&(a< c)==true&&(a<= c)==true&&(a> c)==false&&(a>= c)==false&&(a<=> c)<0&&(a<=> c)!=0&&(a<=> c)<=0&&"");}