| Technical Specification | ||||
| Filesystem library(filesystem TS) | ||||
| Library fundamentals(library fundamentals TS) | ||||
| Library fundamentals 2(library fundamentals TS v2) | ||||
| Library fundamentals 3(library fundamentals TS v3) | ||||
| Extensions for parallelism(parallelism TS) | ||||
| Extensions for parallelism 2(parallelism TS v2) | ||||
| Extensions for concurrency(concurrency TS) | ||||
| Extensions for concurrency 2(concurrency TS v2) | ||||
| Concepts(concepts TS) | ||||
| Ranges(ranges TS) | ||||
| Reflection(reflection TS) | ||||
| Mathematical special functions(special functions TR) | ||||
| Experimental Non-TS | ||||
| Pattern Matching | ||||
| Linear Algebra | ||||
| std::execution | ||||
| Contracts | ||||
| 2D Graphics |
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
constexprint compare(basic_string_view v)constnoexcept; | (1) | (library fundamentals TS) |
constexprint compare(size_type pos1, size_type count1, basic_string_view v)const | (2) | (library fundamentals TS) |
constexprint compare(size_type pos1, size_type count1, basic_string_view v, size_type pos2, size_type count2)const; | (3) | (library fundamentals TS) |
constexprint compare(const CharT* s)const; | (4) | (library fundamentals TS) |
constexprint compare(size_type pos1, size_type count1, const CharT* s)const; | (5) | (library fundamentals TS) |
constexprint compare(size_type pos1, size_type count1, const CharT* s, size_type count2)const; | (6) | (library fundamentals TS) |
Compares two character sequences.
rlen of the sequences to compare is the smaller ofsize() andv.size(). The function compares the two views by callingtraits::compare(data(), v.data(), rlen), and returns a value according to the following table:| Condition | Result | Return value | |
|---|---|---|---|
Traits::compare(data(), v.data(),rlen) < 0 | this isless thanv | <0 | |
Traits::compare(data(), v.data(),rlen) == 0 | size() < v.size() | this isless thanv | <0 |
size() == v.size() | this isequal tov | 0 | |
size() > v.size() | this isgreater thanv | >0 | |
Traits::compare(data(), v.data(),rlen) > 0 | this isgreater thanv | >0 | |
Contents |
| v | - | view to compare |
| s | - | pointer to the character string to compare to |
| count1 | - | number of characters of this view to compare |
| pos1 | - | position of the first character in this view to compare |
| count2 | - | number of characters of the given view to compare |
| pos2 | - | position of the first character of the given view to compare |
negative value if this view is less than the other character sequence, zero if the both character sequences are equal, positive value if this view is greater than the other character sequence.
1) Linear in the number of characters compared.
| lexicographically compares two views (function template)[edit] |