Value type X::value_type The type of the object stored in a container. The value type must be Assignable, but need not be DefaultConstructible. [2]
Iterator type X::iterator The type of iterator used to iterate through a container's elements. The iterator's value type is expected to be the container's value type. A conversion from the iterator type to the const iterator type must exist. The iterator type must be an input iterator. [3]
Const iterator type X::const_iterator A type of iterator that may be used to examine, but not to modify, a container's elements. [3] [4]
Reference type X::reference A type that behaves as a reference to the container's value type. [5]
Const reference type X::const_reference A type that behaves as a const reference to the container's value type. [5]
Pointer type X::pointer A type that behaves as a pointer to the container's value type. [6]
Distance type X::difference_type A signed integral type used to represent the distance between two of the container's iterators. This type must be the same as the iterator's distance type. [2]
Size type X::size_type An unsigned integral type that can represent any nonnegative value of the container's distance type. [2]
Notation

X A type that is a model of Container

a, b Object of type X

T The value type of X

Definitions

The size of a container is the number of elements it contains. The size is a nonnegative number.

The area of a container is the total number of bytes that it occupies. More specifically, it is the sum of the elements' areas plus whatever overhead is associated with the container itself. If a container's value type T is a simple type (as opposed to a container type), then the container's area is bounded above by a constant times the container's size times sizeof(T) . That is, if a is a container with a simple value type, then a 's area is O(a.size()).

A variable sized container is one that provides methods for inserting and/or removing elements; its size may vary during a container's lifetime. A fixed size container is one where the size is constant throughout the container's lifetime. In some fixed-size container types, the size is determined at compile time.

Valid expressions

In addition to the expressions defined in Assignable, EqualityComparable, and LessThanComparable, the following expressions must be valid.

Name Expression Return type
Beginning of range a.begin() iterator if a is mutable, const_iterator otherwise [4] [7]
End of range a.end() iterator if a is mutable, const_iterator otherwise [4]
Size a.size() size_type
Maximum size a.max_size() size_type
Empty container a.empty() Convertible to bool
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

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

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