template<typename Container>
MapAdapter class
Dict-like data structure by std::vector and Range.
| Template parameters | |
|---|---|
| Container | |
MapAdapter Structure: Original Container: [A] [B] [C] [D] [E] [0] [1] [2] [3] [4] <-- Indices become keys MapAdapter Interface: operator[](0) → A operator[](1) → B operator[](2) → C operator[](3) → D operator[](4) → E begin() → iterator to (0, A) end() → iterator past (4, E) enumerate() → [(0, A), (1, B), (2, C), (3, D), (4, E)]
Public functions
Function documentation
template<typename Container>
const mapped_ type& MapAdapter<Container>:: at(const key_ type& key) const
| Returns | a constant reference to the value associated with the given key. |
|---|
The function at() returns a constant reference to the value associated with a given key in a map.
template<typename Container>
bool MapAdapter<Container>:: contains(const key_ type& key) const
| Parameters | |
|---|---|
| key in | The parameter "key" is of type "key_type", which is a data type that represents the key used to search for an element in the container. |
| Returns | a boolean value. It will return true if the key is contained in the data structure, and false otherwise. |
The function checks if a given key is present in a data structure.
template<typename Container>
auto MapAdapter<Container>:: end() const
| Returns | The end iterator of the mapview. |
|---|
The function returns an iterator pointing to the end of the mapview.