From 8a26617ffdaad0031810f4d3c90f34058fa26719 Mon Sep 17 00:00:00 2001 From: fruffy Date: Mon, 2 Oct 2023 14:26:42 +0200 Subject: [PATCH] Remove namespace masking. --- lib/hvec_map.h | 10 ---------- lib/map.h | 10 ---------- lib/ordered_map.h | 10 ---------- 3 files changed, 30 deletions(-) diff --git a/lib/hvec_map.h b/lib/hvec_map.h index 8423d3472d9..2bfbb2b9fa3 100644 --- a/lib/hvec_map.h +++ b/lib/hvec_map.h @@ -293,13 +293,6 @@ class hvec_map : hash_vector_base { } }; -// XXX(seth): We use this namespace to hide our get() overloads from ADL. GCC -// 4.8 has a bug which causes these overloads to be considered when get() is -// called on a type in the global namespace, even if the number of arguments -// doesn't match up, which can trigger template instantiations that cause -// errors. -namespace GetImpl { - template inline V get(const hvec_map &m, T key, V def = V()) { auto it = m.find(key); @@ -336,7 +329,4 @@ inline const V *getref(const hvec_map *m, T key) { return m ? getref(*m, key) : 0; } -} // namespace GetImpl -using namespace GetImpl; // NOLINT(build/namespaces) - #endif /* LIB_HVEC_MAP_H_ */ diff --git a/lib/map.h b/lib/map.h index e9db50bfce5..fcbf2d0a61c 100644 --- a/lib/map.h +++ b/lib/map.h @@ -19,13 +19,6 @@ limitations under the License. #include -// XXX(seth): We use this namespace to hide our get() overloads from ADL. GCC -// 4.8 has a bug which causes these overloads to be considered when get() is -// called on a type in the global namespace, even if the number of arguments -// doesn't match up, which can trigger template instantiations that cause -// errors. -namespace GetImpl { - template inline V get(const std::map &m, T key, V def = V()) { auto it = m.find(key); @@ -62,9 +55,6 @@ inline const V *getref(const std::map *m, T key) { return m ? getref(*m, key) : 0; } -} // namespace GetImpl -using namespace GetImpl; // NOLINT(build/namespaces) - /* iterate over the keys in a map */ template class IterKeys { diff --git a/lib/ordered_map.h b/lib/ordered_map.h index 8dc2801433b..e1d67b8e600 100644 --- a/lib/ordered_map.h +++ b/lib/ordered_map.h @@ -254,13 +254,6 @@ class ordered_map { } }; -// XXX(seth): We use this namespace to hide our get() overloads from ADL. GCC -// 4.8 has a bug which causes these overloads to be considered when get() is -// called on a type in the global namespace, even if the number of arguments -// doesn't match up, which can trigger template instantiations that cause -// errors. -namespace GetImpl { - template inline V get(const ordered_map &m, T key, V def = V()) { auto it = m.find(key); @@ -297,7 +290,4 @@ inline const V *getref(const ordered_map *m, T key) { return m ? getref(*m, key) : 0; } -} // namespace GetImpl -using namespace GetImpl; // NOLINT(build/namespaces) - #endif /* LIB_ORDERED_MAP_H_ */