Element Access
Method |
---|
MapContainer |
Access and throw exception if it doesn't exist |
mapped_type &at(const key_type &k); |
const mapped_type &at(const key_type &k) const; |
Access and create new element if it doesn't exist |
mapped_type &operator[] (const key_type &k); |
mapped_type &operator[] (key_type &&k); |
template <typename... Targs> mapped_type &operator()(const dimension_type &x1, const Targs &...xs); |
Parameters
k
- the key of the element to findx1
- the value of the element to find in the first dimensionxs
- the value of the element to find in other dimensions
Return value
A reference to the element associated with that key.
Exceptions
std::out_of_range
if the container does not have an element with the specified key
Complexity
\[
O(m \log n)
\]
Notes
Unlike in a pareto::spatial_map
, the insert
operation for fronts is allowed to fail when the new element is already dominated by the front. In this case, the operator[]
will return a reference to a placeholder that is not ultimately inserted in the front.
Info
See the section on spatial containers / element access for more information.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
1 |
|