An abstract basic associative container.
Defined in: assoc_container.hpp
Parameter | Description | Default Value |
typename Key |
Key type. |
- |
typename Mapped |
Mapped type. |
- |
class Tag |
Data structure tag. |
- |
class Policy_Tl |
Policy typelist. Contains subclasses' policies. |
- |
class Allocator |
Allocator type. |
- |
Type | Definition | Description |
size_type |
typename Allocator::size_type |
Size type. |
difference_type |
typename Allocator::difference_type |
Difference type. |
Type | Definition | Description |
container_category |
Tag |
The underlying mapped-structure tag of the container. This is one of: |
Type | Definition | Description |
allocator |
Allocator |
Allocator type. |
Type | Definition | Description |
key_type |
typename allocator::template rebind< Key>::other::value_type |
Key type. |
key_reference |
typename allocator::template rebind< key_type>::other::reference |
Key reference type. |
const_key_reference |
typename allocator::template rebind< key_type>::other::const_reference |
Const key reference type. |
key_pointer |
typename allocator::template rebind< key_type>::other::pointer |
Key pointer type. |
const_key_pointer |
typename allocator::template rebind< key_type>::other::const_pointer |
Const key pointer type. |
Type | Definition | Description |
mapped_type |
Mapped |
Mapped type. |
mapped_reference |
typename allocator::template rebind< mapped_type>::other::reference |
Mapped reference type. |
const_mapped_reference |
typename allocator::template rebind< mapped_type>::other::const_reference |
Const mapped reference type. |
mapped_pointer |
typename allocator::template rebind< mapped_type>::other::pointer |
Mapped pointer type. |
const_mapped_pointer |
typename allocator::template rebind< mapped_type>::other::const_pointer |
Const mapped pointer type. |
Type | Definition | Description |
value_type |
|
Value type. |
reference |
typename allocator::template rebind< value_type>::other::reference |
Value reference type. |
const_reference |
typename allocator::template rebind< value_type>::other::const_reference |
Const value reference type. |
pointer |
typename allocator::template rebind< value_type>::other::pointer |
Value pointer type. |
const_pointer |
typename allocator::template rebind< value_type>::other::const_pointer |
Const Value pointer type. |
Type | Definition | Description |
const_point_iterator |
Const point-type iterator. |
Const point-type iterator. |
point_iterator |
|
Point-type iterator. |
const_iterator |
Const range-type iterator. |
Const range-type iterator. |
iterator |
|
Range-type iterator. |
Method | Description |
virtual ~container_base () |
Destructor. |
Method | Description |
inline size_type size () const |
Returns the number of distinct value_type objects the container object is storing. |
inline size_type max_size () const |
Returns an upper bound on the number of distinct value_type objects this container can store. |
inline bool empty () const |
Returns whether the container object is not storing any value_type objects. |
Method | Description |
std::pair<point_iterator, bool> insert (const_reference r_val) |
Inserts a value_type object. If no value_type with r_val's key was in the container object, inserts and returns (point_iterator object associated with r_val, true); otherwise just returns (point_iterator object associated with r_val's key, false). |
mapped_reference operator[] (const_key_reference r_key) |
Subscript operator. |
Method | Description |
point_iterator find (const_key_reference r_key) |
Returns the point_iterator corresponding to the value_type with r_key as its key, or the point_iterator corresponding to the just-after-last entry if no such value_type. |
const_point_iterator find (const_key_reference r_key) const |
Returns the const_point_iterator corresponding to the value_type with r_key as its key, or the const_point_iterator corresponding to the just-after-last entry if no such value_type. |
Method | Description |
bool erase (const_key_reference r_key) |
Erases the value_type associated with r_key. returns false iff r_key was not contained. |
template< class Pred> size_type erase_if (Pred prd) |
Erases any value_type satisfying the predicate prd (this is transactional, either all matching value_types are erased, or, if an exception is thrown (for types whose erase can throw an exception) none); returns the number of value_types erased. |
void clear () |
Clears the container object. |
Method | Description |
iterator begin () |
Returns an iterator corresponding to the first value_type in the container. |
const_iterator begin () const |
Returns a const_iterator corresponding to the first value_type in the container. |
iterator end () |
Returns an iterator corresponding to the just-after-last value_type in the container. |
const_iterator end () const |
Returns a const_iterator corresponding to the just-after-last value_type in the container. |