valsort_map.hpp
This file defines a map that is sorted by value, not key.
valsort_map is a limited implementation of map that also keeps track of the values set, in order, as you go. This is accomplished by keeping a second data structure, a sorted set, of all of the values maintained in the map.
The member functions cbegin() and cend() work as in map, but cvbegin() and cvend() produce the same set of results, except in value order. (reverse versions of each work as well)
Note
Status: ALPHA
-
template<class Key, class T>
class valsort_map - #include <valsort_map.hpp>
Public Types
Public Functions
-
inline valsort_map()
-
valsort_map(const valsort_map&) = default
-
valsort_map(valsort_map&&) = default
-
inline ~valsort_map()
-
inline size_t size() const
-
inline const mapped_type &Get(key_type key)
-
inline void Set(key_type key, const mapped_type &value)
-
inline auto cbegin()
-
inline auto cend()
-
inline auto crbegin()
-
inline auto crend()
-
inline auto cvbegin()
-
inline auto cvend()
-
inline auto crvbegin()
-
inline auto crvend()
-
struct SortOrder
Public Functions
-
inline bool operator()(const value_type &in1, const value_type &in2) const
-
inline bool operator()(const value_type &in1, const value_type &in2) const
-
inline valsort_map()