a != b T is EqualityComparable Convertible to bool
Less a < b T is LessThanComparable Convertible to bool
Greater a > b T is LessThanComparable Convertible to bool
Less or equal a <= b T is LessThanComparable Convertible to bool
Greater or equal a >= b T is LessThanComparable Convertible to bool
Expression semantics

Semantics of an expression is defined only where it is not defined in Container, EqualityComparable, or LessThanComparable, or where there is additional information.

Name Expression Semantics
Equality a == b Returns true if a.size() == b.size() and if each element of a compares equal to the corresponding element of b. Otherwise returns false.
Less a < b Equivalent to lexicographical_compare(a,b)
Complexity guarantees

The equality and inequality operations are linear in the container's size.

Invariants
Ordering Two different iterations through a forward container will access its elements in the same order, providing that there have been no intervening mutative operations.
Models

• vector

• list

• slist

• deque

• set

• hash_set

• map

• hash_map

• multiset

• hash_multiset

• multimap

• hash_multimap

See also

The iterator overview, Forward Iterator, Sequence

Reversible Container

Category: containers

Component type: concept

Description

A Reversible Container is a Forward Container whose iterators are Bidirectional Iterators. It allows backwards iteration through the container.

Refinement of

Forward Container

Associated types

Two new types are introduced. In addition, the iterator type and the const iterator type must satisfy a more stringent requirement than for a Forward Container. The iterator and reverse iterator types must be Bidirectional Iterators, not merely Forward Iterators.

Reverse iterator type X::reverse_iterator A Reverse Iterator adaptor whose base iterator type is the container's iterator type. Incrementing an object of type reverse_iterator moves backwards through the container: the Reverse Iterator adaptor maps operator++ to operator--
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату
×