summaryrefslogtreecommitdiff
path: root/g_src/bimap.h
diff options
context:
space:
mode:
Diffstat (limited to 'g_src/bimap.h')
-rwxr-xr-xg_src/bimap.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/g_src/bimap.h b/g_src/bimap.h
new file mode 100755
index 0000000..968f770
--- /dev/null
+++ b/g_src/bimap.h
@@ -0,0 +1,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