Namespaces
Variants
Views
Actions

operator==,!=,<,<=,>,>=(std::basic_string)

From cppreference.com
< cpp‎ | string‎ | basic string
Revision as of 10:34, 19 March 2012 by P12 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:cpp/container/basic string/sidebar Template:ddcl list begin

Template:ddcl list end

Compares the contents of two containers.

1-2) Checks if the contents of lhs and rhs are equal, that is, Template:cpp and each element in lhs has equivalent element in rhs at the same position.

3-6) Compares the contents of lhs and rhs lexicographically. The comparison is performed by a function equivalent to Template:cpp.

Parameters

lhs, rhs - containers whose contents to compare

Return value

1) Template:cpp if the contents of the containers are equivalent, Template:cpp otherwise

2) Template:cpp if the contents of the containers are not equivalent, Template:cpp otherwise

3) Template:cpp if the contents of the lhs are lexicographically less than the contents of rhs, Template:cpp otherwise

4) Template:cpp if the contents of the lhs are lexicographically less than or equal the contents of rhs, Template:cpp otherwise

5) Template:cpp if the contents of the lhs are lexicographically greater than the contents of rhs, Template:cpp otherwise

6) Template:cpp if the contents of the lhs are lexicographically greater than or equal the contents of rhs, Template:cpp otherwise

Complexity

linear in the size of the container