Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the develop branch, built from commit adcd4c09f0.
PrevUpHomeNext
basic_static_string::compare (4 of 9 overloads)

Compare a string with the string.

Synopsis
constexpr int
compare(
    const_pointer s) const;
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.


PrevUpHomeNext