|
inline |
Compares two character sequences.
str | The other string to compare to. |
*this
appears before the character sequence specified by the arguments, in lexicographical order.*this
appears after the character sequence specified by the arguments, in lexicographical order. count1
characters starting at data1
is compared to a character sequence consisting of count2
characters starting at data2
as follows:size_type rlen = std::min(count1, count2)
.traits_t::compare(data1, data2, rlen)
. For standard strings this function performs character-by-character lexicographical comparison. If the result is zero (the character sequences are equal so far), then their sizes are compared as follows: Condition | Result | Return value |
---|---|---|
traits_t::compare(data1, data2, rlen) < 0 | data1 is less than data2 | < 0 |
traits_t::compare(data1, data2, rlen) == 0 and size1 < size2 | data1 is less than data2 | < 0 |
traits_t::compare(data1, data2, rlen) == 0 and size1 == size2 | data1 is equal to data2 | 0 |
traits_t::compare(data1, data2, rlen) == 0 and size1 > size2 | data1 is greater than data2 | > 0 |
traits_t::compare(data1, data2, rlen) > 0 | data1 is greater than data2 | > 0 |