Standard Template Library Programmer's Guide

Здесь есть возможность читать онлайн «Standard Template Library Programmer's Guide» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Жанр: Программирование, Справочники, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Standard Template Library Programmer's Guide: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Standard Template Library Programmer's Guide»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

This document contains reference on SGI STL implementation

Standard Template Library Programmer's Guide — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Standard Template Library Programmer's Guide», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать
See also

Associative Container, Multiple Associative Container, Unique Sorted Associative Container, Multiple Sorted Associative Container

Multiple Associative Container

Category: containers

Component type: concept

Description

A Multiple Associative Container is an Associative Container in which there may be more than one element with the same key. That is, it is an Associative Container that does not have the restrictions of a Unique Associative Container.

Refinement of

Associative Container

Associated types

None, except for those defined by Associative Container

Notation

XA type that is a model of Multiple Associative Container

aObject of type X

tObject of type X::value_type

kObject of type X::key_type

p, qObject of type X::iterator

Valid expressions

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

Name Expression Type requirements Return type
Range constructor X(i, j) X a(i, j); i and j are Input Iterators whose value type is convertible to T [1]
Insert element a.insert(t) X::iterator
Insert range a.insert(i, j) i and j are Input Iterators whose value type is convertible to X::value_type . void
Expression semantics
Name Expression Precondition Semantics Postcondition
Range constructor X(i, j) X a(i, j); [i,j) is a valid range. Creates an associative container that contains all elements in the range [i,j) . size() is equal to the distance from i to j . Each element in [i, j) is present in the container.
Insert element a.insert(t) Inserts t into a . The size of a is incremented by 1 . The value of a.count(t) is incremented by a .
Insert range a.insert(i, j) [i, j) is a valid range. Equivalent to a.insert(t) for each object t that is pointed to by an iterator in the range [i, j) . Each element is inserted into a . The size of a is incremented by j – i .
Complexity guarantees

Average complexity for insert element is at most logarithmic.

Average complexity for insert range is at most O(N * log(size() + N)) , where N is j – i .

Models

• multiset

• multimap

• hash_multiset

• hash_multimap

Notes

[1] At present (early 1998), not all compilers support "member templates". If your compiler supports member templates then i and j may be of any type that conforms to the Input Iterator requirements. If your compiler does not yet support member templates, however, then i and j must be of type const T* or of type X::const_iterator .

See also

Associative Container, Unique Associative Container, Unique Sorted Associative Container, Multiple Sorted Associative Container

Unique Sorted Associative Container

Category: containers

Component type: concept

Description

A Unique Sorted Associative Container is a Sorted Associative Container that is also a Unique Associative Container. That is, it is a Sorted Associative Container with the property that no two elements in the container have the same key.

Refinement of

Sorted Associative Container, Unique Associative Container

Associated types

None, except for those described in the Sorted Associative Container and Unique Associative Container requirements.

Notation

XA type that is a model of Unique Sorted Associative Container

aObject of type X

tObject of type X::value_type

kObject of type X::key_type

p, qObject of type X::iterator

cObject of type X::key_compare

Valid expressions

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

Name Expression Type requirements Return type
Range constructor X(i, j) X a(i, j); i and j are Input Iterators whose value type is convertible to T [1].
Range constructor with compare X(i, j, c) X a(i, j, c); i and j are Input Iterators whose value type is convertible to T [1]. c is an object of type key_compare .
Insert with hint a.insert(p, t) iterator
Insert range a.insert(i, j) i and j are Input Iterators whose value type is convertible to X::value_type . [1] void
Expression semantics
Name Expression Precondition Semantics Postcondition
Range constructor X(i, j) X a(i, j); [i,j) is a valid range. Creates an associative container that contains all of the elements in the range [i,j) that have unique keys. The comparison object used by the container is key_compare() . size() is less than or equal to the distance from i to j .
Range constructor with compare X(i, j, c) X a(i, j, c); [i,j) is a valid range. Creates an associative container that contains all of the elements in the range [i,j) that have unique keys. The comparison object used by the container is c . size() is less than or equal to the distance from i to j .
Insert with hint a.insert(p, t) p is a nonsingular iterator in a . Inserts t into a if and only if a does not already contain an element whose key is equivalent to t 's key. The argument p is a hint: it points to the location where the search will begin. The return value is a dereferenceable iterator that points to the element with a key that is equivalent to that of t . a contains an element whose key is the same as that of t . The size of a is incremented by either 1 or 0 .
Insert range a.insert(i, j) [i, j) is a valid range. Equivalent to a.insert(t) for each object t that is pointed to by an iterator in the range [i, j) . Each element is inserted into a if and only if a does not already contain an element with an equivalent key. The size of a is incremented by at most j – i .
Complexity guarantees

The range constructor, and range constructor with compare, are in general O(N * log(N)) , where N is the size of the range. However, they are linear in N if the range is already sorted by value_comp() .

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Standard Template Library Programmer's Guide»

Представляем Вашему вниманию похожие книги на «Standard Template Library Programmer's Guide» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Standard Template Library Programmer's Guide»

Обсуждение, отзывы о книге «Standard Template Library Programmer's Guide» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x