Home | Libraries | People | FAQ | More |
Important | |
---|---|
Work-in-progress. |
A NestedContainer is a Container that can store sequences of elements and ordered sequences.
Table 1.9. Types
Name |
Type |
Notes |
---|---|---|
|
SequenceContainer. |
|
|
AssociativeContainer. |
|
|
A NestedContainer must keep track of whether the stored type is value_type
, array_type
,
or map_type
. The semantics
of insertion and erasure depends on the stored type.
Table 1.10. Singular semantics
Expression |
Return type |
Singular semantics |
Conditions |
---|---|---|---|
|
|
Assigns value-initialized |
Effects:
|
|
|
No effect. |
Returns:
Iterator |
|
|
No effect. |
Returns:
Iterator |
|
|
Fails. |
|
|
|
Fails. |
|
|
|
Fails. |
|
|
|
Fails. |
Table 1.11. Sequence semantics
Expression |
Return type |
Sequence semantics |
Conditions |
---|---|---|---|
|
|
Removes all nested elements. |
Effects:
|
|
|
Removes a given element. |
Requires:
Effects:
Erases the element pointed to by Returns:
Iterator pointing to the element immediately following |
|
|
Removes all elements in range. |
Requires:
Effects:
Erases the elements in the range [ Returns:
Iterator pointing to the element pointed to by |
|
|
Inserts element at end. |
Requires:
Effects:
Returns:
Iterator |
|
|
Inserts all elements in range at end. |
Requires:
Effects:
|
|
|
Inserts element before position. |
Requires:
Effects:
Inserts a copy of Returns:
Iterator |
|
|
Inserts all elements in range before position. |
Requires:
Effects:
Inserts a copy of each element in the range [ |
Table 1.12. Associative semantics
Expression |
Return type |
Associative semantics |
Conditions |
---|---|---|---|
|
|
Removes all nested elements. |
Effects:
|
|
|
Removes a given element. |
Effects:
Erases the element pointed to by Returns:
Iterator pointing to the element immediately following |
|
|
Removes all elements in range. |
Effects:
Erases the elements in the range [ Returns:
Iterator pointing to the element pointed to by |
|
|
Inserts |
Requires:
Effects:
p = std::find(a.begin(), a.end(), get<0>(t)) a.insert(p, t)
|
|
|
Inserts all elements in range [ |
Requires:
Each elements in range [ |
|
|
Inserts |
Requires:
|
|
|
Inserts all elements in range [ |
Requires:
Each elements in range [ |
A DynamicContainer is a NestedContainer that can also store heterogenous elements, one of which is a nullable element indicating the absence of a value.
Table 1.13. Nullable semantics
Expression |
Return type |
Nullable semantics |
Conditions |
---|---|---|---|
|
|
No effect. |
|
|
|
No effect. |
Returns:
Iterator |
|
|
No effect. |
Returns:
Iterator |
|
|
Changes stored type to SequenceContainer and inserts element. |
Requires:
Effects:
Returns:
Iterator |
|
|
Changes stored type to SequenceContainer and inserts all elements in range. |
Requires:
Effects:
|
|
|
Fails. |
|
|
|
Fails. |