Public Member Functions | List of all members
lazylookup::generic_map< M, K, V > Class Template Reference

#include <lazylookup.hh>

Public Member Functions

 generic_map (std::function< V(K)> fn, V dummy=V())
 
at (K key)
 
operator[] (K key)
 
std::size_t get_n_filled () const
 

Detailed Description

template<class M, typename K, typename V>
class lazylookup::generic_map< M, K, V >

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.


The documentation for this class was generated from the following file: