Template Class variant_map

Nested Relationships

Nested Types

Class Documentation

template<typename ...Maps>
class variant_map

Public Types

using variant_type = std::variant<std::monostate, Maps*...>
using first_map = typename std::tuple_element<0, std::tuple<Maps...>>::type
using key_type = typename public_key<typename first_map::key_type>::type
using mapped_type = typename first_map::mapped_type
using value_type = std::pair<const key_type, mapped_type>
using underlying_iterator_variant = std::variant<typename Maps::iterator...>

Public Functions

inline variant_map()
template<typename MapT>
inline variant_map(MapT *map)
inline iterator begin() const
inline iterator end() const
inline iterator find(const key_type &key) const
inline size_t erase(const key_type &key)
inline size_t erase(const iterator &it)
inline std::pair<iterator, bool> insert(const value_type &value)

Public Members

variant_type map_

Public Static Functions

template<typename MapT>
static inline bool to_map_key(const key_type &key, typename MapT::key_type &out)
template<typename Pair>
static inline value_type to_value(const Pair &pair)
template<typename K>
struct is_char_array : public std::false_type
template<size_t N>
struct is_char_array<std::array<char, N>> : public std::true_type
class iterator

Public Types

using value_type = variant_map::value_type
using difference_type = std::ptrdiff_t
using pointer = value_type*
using reference = value_type
using iterator_category = std::forward_iterator_tag

Public Functions

iterator() = default
inline explicit iterator(underlying_iterator_variant iterator_variant)
inline iterator(const iterator &other)
inline iterator &operator=(const iterator &other)
inline value_type operator*() const
inline value_type *operator->() const
inline iterator &operator++()
inline iterator operator++(int)
inline bool operator==(const iterator &other) const
inline bool operator!=(const iterator &other) const

Public Members

underlying_iterator_variant it_var
mutable std::unique_ptr<value_type> cached_value_ptr_
template<typename K>
struct public_key

Public Types

using type = K
template<size_t N>
struct public_key<std::array<char, N>>

Public Types

using type = std::string