Книга: Standard Template Library Programmer
Simple Associative Container
Разделы на этой странице:
Simple Associative Container
Category: containers
Component type: concept
Description
A Simple Associative Container is an Associative Container where elements are their own keys. A key in a Simple Associative Container is not associated with any additional value.
Refinement of
Associative Container
Associated types
None, except for those described in the Associative Container requirements. Simple Associative Container, however, introduces two new type restrictions.
Key type | X::key_type |
The type of the key associated with X::value_type. The types key_type and value_type must be the same type. |
Iterator | X::iterator |
The type of iterator used to iterate through a Simple Associative Container's elements. The types X::iterator and X::const_iterator must be the same type. That is, a Simple Associative Container does not provide mutable iterators. [1] |
Notation
X
A type that is a model of Simple Associative Container
a
Object of type X
k
Object of type X::key_type
p, q
Object of type X::iterator
Valid expressions
None, except for those defined in the Associative Container requirements.
Invariants
Immutability of Elements | Every element of a Simple Associative Container is immutable. Objects may be inserted and erased, but not modified. [1] |
Models
• set
• multiset
• hash_set
• hash_multiset
Notes
[1] This is a consequence of the Immutability of Keys invariant of Associative Container. Keys may never be modified; values in a Simple Associative Container are themselves keys, so it immediately follows that values in a Simple Associative Container may not be modified.
See also
Associative Container, Pair Associative Container
- Associative Container
- Simple Associative Container
- Pair Associative Container
- Sorted Associative Container
- Hashed Associative Container
- Hash Function
- Unique Associative Container
- Multiple Associative Container
- Unique Sorted Associative Container
- Multiple Sorted Associative Container
- Unique Hashed Associative Container
- Multiple Hashed Associative Container
- Multiple Associative Container
- Associative Container
- Associative Containers
- Pair Associative Container
- Multiple Sorted Associative Container
- Unique Hashed Associative Container
- Листинг 10.1. (simpleid.c) Отображение идентификаторов пользователя и группы
- The Simplest Windows Program
- A Simple Perl Program
- Using a Simple Script to Automate Tasks
- 9.10. Building a Simple File System
- CHAPTER 6 Simple PIC18 Projects