aboutsummaryrefslogtreecommitdiff
path: root/src/string_map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_map.cpp')
-rw-r--r--src/string_map.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/string_map.cpp b/src/string_map.cpp
index 218a45482..e2a4d5f65 100644
--- a/src/string_map.cpp
+++ b/src/string_map.cpp
@@ -30,6 +30,8 @@ struct StringMapEntry {
template <typename T>
struct StringMap {
+ using K = String;
+ using V = T;
Slice<MapIndex> hashes;
Array<StringMapEntry<T> > entries;
};
@@ -270,3 +272,24 @@ gb_inline void string_map_clear(StringMap<T> *h) {
}
}
+
+
+template <typename T>
+StringMapEntry<T> *begin(StringMap<T> &m) {
+ return m.entries.data;
+}
+template <typename T>
+StringMapEntry<T> const *begin(StringMap<T> const &m) {
+ return m.entries.data;
+}
+
+
+template <typename T>
+StringMapEntry<T> *end(StringMap<T> &m) {
+ return m.entries.data + m.entries.count;
+}
+
+template <typename T>
+StringMapEntry<T> const *end(StringMap<T> const &m) {
+ return m.entries.data + m.entries.count;
+} \ No newline at end of file