Empirical
Classes | Namespaces
valsort_map.h File Reference

This file defines a map that is sorted by value, not key. More...

#include <map>
#include "../base/vector.h"

Go to the source code of this file.

Classes

class  emp::valsort_map< Key, T >
 

Namespaces

 emp
 If we are in emscripten, make sure to include the header.
 

Detailed Description

This file defines a map that is sorted by value, not key.

Note
This file is part of Empirical, https://github.com/devosoft/Empirical
Date
2018
Note
Status: ALPHA

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)