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

auto at(const key_type& key) const -> const mapped_type&
auto contains(const key_type& key) const -> bool
auto size() const -> size_t
auto begin() const -> auto
auto end() const -> auto

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>
size_t MapAdapter<Container>::size() const

Returns The size of the _rng object is being returned.

The size() function returns the size of the _rng container.

template<typename Container>
auto MapAdapter<Container>::begin() const

Returns The begin() function is returning an iterator pointing to the beginning of the mapview container.

The function returns an iterator pointing to the beginning of the mapview.

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.