chsvlib
chsv helper source code

◆ operator<=>()

auto Chusov::Memory::operator<=> ( const sbo_vector< ValueTypeLeft, sbo_threshold_left, AllocatorLeft > &  left,
const sbo_vector< ValueTypeRight, sbo_threshold_right, AllocatorRight > &  right 
)

In C++20 performs three-way lexicographical comparison of elements of two SBO vectors.

Template Parameters
ValueTypeLeftA type of an element of the first vector.
sbo_threshold_leftA maximal number of elements stored in stack associated with the first vector.
AllocatorLeftA type of an allocator used by the first vector.
ValueTypeRightA type of an element of the second vector.
sbo_threshold_rightA maximal number of elements stored in stack associated with the second vector.
AllocatorRightA type of an allocator used by the second vector.
Parameters
leftThe first vector.
rightThe second vector.
Returns
The return type is the same as one returned by the 3-way comparison of elements of the vectors. The return value is determined by a lexicographical comparison of vector elements: the first pair of unequal elements of the vectors, as determined by three-way comparison applied to the pair, define the same return value of the vector comparison. If there is no such pair, i.e. elements of the vectors are not pairwise equal, then, if sizes of the vectos match, the vector comparison returns equivalent (of the respective ordering type). Otherwise, the shorter vector is considered smaller.