summaryrefslogtreecommitdiff
path: root/g_src/bimap.h
blob: 968f770bf129699e97ed95587ae637b38a9128bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef BIMAP_H
#define BIMAP_H

#include <map>

template<typename A, typename B>
struct bimap {
  std::map<A,B> left;
  std::map<B,A> right;

  void insert(A a, B b) {
    left.insert(std::pair<A,B>(a,b));
    right.insert(std::pair<B,A>(b,a));
  }
};

#endif