| Home | Libraries | People | FAQ | More

##### basic_static_string::compare (4 of 9 overloads)

Compare a string with the string.

###### Synopsis

    constexpr int
    compare(
        basic_static_string::const_pointer s) const noexcept;

###### Description

Let `len` be `traits_type::length(s)` and `comp` be `traits_type::compare(data(), s, std::min(size(), len)`. If `comp != 0`, then the result is `comp`. Otherwise, the result is `0` if `size() == len`, `-1` if `size() < len`, and `1` otherwise.

###### Complexity

Linear.

###### Return Value

The result of lexicographically comparing `s` and the string.

###### Parameters

Name | Description
--- | ---
`s` | The string to compare.