#include <lazylookup.hh>
Public Member Functions | |
generic_map (std::function< V(K)> fn, V dummy=V()) | |
V | at (K key) |
V | operator[] (K key) |
std::size_t | get_n_filled () const |
A lazy generic map (allowing choice of anything that has a mappish interface for storage).
To avoid two lookups, an insertion with a dummy val is always attempted. You may define what that is in the constructor if it's somehow helpful (i.e. if your value type might be expensive to create in some cases). If that's a problem, using a pointer type might make sense.
Definition at line 48 of file lazylookup.hh.