Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
basic_static_string::compare (1 of 9 overloads)

Compare a string with the string.

Synopsis
template<
    std::size_t M>
constexpr int
compare(
    const basic_static_string< M, CharT, Traits >& s) const;
Description

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

Complexity

Linear.

Return Value

The result of lexicographically comparing s and the string.

Template Parameters

Type

Description

M

The size of the string to compare with.

Parameters

Name

Description

s

The string to compare.


PrevUpHomeNext