6 template <typename G, typename K, typename V, template <typename, typename> class MapBase >
7 class VectorMap : public MapBase<G, K> {
12 VectorMap(G& g) : MapBase<G, K>(g) {
20 ValueType& operator[](const K& key) {
21 return container[key->id];
24 const ValueType& operator[](const K& key) const {
25 return container[key->id];
28 const ValueType& get(const K& key) const {
29 return container[key->id];
32 void set(const K& key, const ValueType& val) {
33 container[key->id] = val;
36 void add(const K& key) {
37 container.resize(key->id);
40 void erase(const K& key) {}
43 typedef std::vector<ValueType> Container;