Template Class map_transformer

Nested Relationships

Nested Types

Class Documentation

template<typename BaseMap, typename Transform, typename TransformBack = void>
class map_transformer

Public Types

using key_type = typename BaseMap::key_type
using base_mapped_type = typename BaseMap::mapped_type
using transformed_mapped_type = std::invoke_result_t<Transform, base_mapped_type>
using value_type = std::pair<key_type, transformed_mapped_type>
using mapped_type = transformed_mapped_type
using back_storage = typename std::conditional<read_only, back_storage_fallback, TransformBack>::type

Public Functions

template<typename TB = TransformBack, typename std::enable_if<std::is_void<TB>::value, int>::type = 0>
inline map_transformer(BaseMap *base_map, Transform transform)
template<typename TB = TransformBack, typename std::enable_if<!std::is_void<TB>::value, int>::type = 0>
inline map_transformer(BaseMap *base_map, Transform transform, TB transform_back)
inline iterator begin()
inline iterator end()
inline iterator find(const key_type &key)
inline std::pair<iterator, bool> insert(const value_type &value)
inline size_t erase(const key_type &key)

Public Static Attributes

static constexpr bool read_only = std::is_void<TransformBack>::value
struct back_storage_fallback
class iterator

Public Types

using base_iterator = typename BaseMap::iterator
using iterator_category = std::forward_iterator_tag
using difference_type = typename std::iterator_traits<base_iterator>::difference_type
using key_type = typename BaseMap::key_type
using transformed_mapped_type = std::invoke_result_t<Transform, typename BaseMap::mapped_type>
using value_type = std::pair<key_type, transformed_mapped_type>

Public Functions

inline iterator()
inline iterator(base_iterator base_iterator, Transform *transform)
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