must be X::key_type.
X::value_compare The type of a Strict Weak Ordering used to compare values. Its argument type must be X::value_type, and it compares two objects of value_type by passing the keys associated with those objects to a function object of type key_compare.
Notation

X A type that is a model of Sorted Associative Container

a Object of type X

t Object of type X::value_type

k Object of type X::key_type

p, q Object of type X::iterator

c Object of type X::key_compare

Valid expressions

In addition to the expressions defined in Associative Container and Reversible Container, the following expressions must be valid.

Name Expression Return type
Default constructor X() X a;
Constructor with compare X(c) X a(c);
Key comparison a.key_comp() X::key_compare
Value comparison a::value_compare() X::value_compare
Lower bound a.lower_bound(k) iterator if a is mutable, otherwise const_iterator.
Upper bound a.upper_bound(k) iterator if a is mutable, otherwise const_iterator.
Equal range a.equal_range(k) pair<iterator, iterator> if a is mutable, otherwise pair<const_iterator, const_iterator>.
Expression semantics
Name Expression Semantics Postcondition
Default constructor X() X a; Creates an empty container, using key_compare() as the comparison object. The size of the container is 0.
Constructor with compare X(c) X a(c); Creates an empty container, using c as the comparison object. The size of the container is 0. key_comp () returns a function object that is equivalent to c.
Key comparison a.key_comp() Returns the key comparison object used by a.
Value comparison a::value_compare() Returns the value comparison object used by a.
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

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

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