Replace compiler for loops for the hash-table types to simplify code usage

This commit is contained in:
gingerBill
2022-12-09 11:29:28 +00:00
parent ffe953b43d
commit 34a048f7da
18 changed files with 269 additions and 209 deletions

View File

@@ -339,3 +339,24 @@ void multi_map_remove_all(PtrMap<K, V> *h, K key) {
}
}
#endif
template <typename K, typename V>
PtrMapEntry<K, V> *begin(PtrMap<K, V> &m) {
return m.entries.data;
}
template <typename K, typename V>
PtrMapEntry<K, V> const *begin(PtrMap<K, V> const &m) {
return m.entries.data;
}
template <typename K, typename V>
PtrMapEntry<K, V> *end(PtrMap<K, V> &m) {
return m.entries.data + m.entries.count;
}
template <typename K, typename V>
PtrMapEntry<K, V> const *end(PtrMap<K, V> const &m) {
return m.entries.data + m.entries.count;
}