Skip to content

Commit

Permalink
Remove namespace masking.
Browse files Browse the repository at this point in the history
  • Loading branch information
fruffy committed Dec 14, 2023
1 parent 7a18502 commit 6fc151c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
10 changes: 0 additions & 10 deletions lib/hvec_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class K, class T, class V, class Comp, class Alloc>
inline V get(const hvec_map<K, V, Comp, Alloc> &m, T key, V def = V()) {
auto it = m.find(key);
Expand Down Expand Up @@ -336,7 +329,4 @@ inline const V *getref(const hvec_map<K, V, Comp, Alloc> *m, T key) {
return m ? getref(*m, key) : 0;
}

} // namespace GetImpl
using namespace GetImpl; // NOLINT(build/namespaces)

#endif /* LIB_HVEC_MAP_H_ */
10 changes: 0 additions & 10 deletions lib/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ limitations under the License.

#include <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 <class K, class T, class V, class Comp, class Alloc>
inline V get(const std::map<K, V, Comp, Alloc> &m, T key, V def = V()) {
auto it = m.find(key);
Expand Down Expand Up @@ -62,9 +55,6 @@ inline const V *getref(const std::map<K, V, Comp, Alloc> *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 PairIter>
class IterKeys {
Expand Down
10 changes: 0 additions & 10 deletions lib/ordered_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class K, class T, class V, class Comp, class Alloc>
inline V get(const ordered_map<K, V, Comp, Alloc> &m, T key, V def = V()) {
auto it = m.find(key);
Expand Down Expand Up @@ -297,7 +290,4 @@ inline const V *getref(const ordered_map<K, V, Comp, Alloc> *m, T key) {
return m ? getref(*m, key) : 0;
}

} // namespace GetImpl
using namespace GetImpl; // NOLINT(build/namespaces)

#endif /* LIB_ORDERED_MAP_H_ */

0 comments on commit 6fc151c

Please sign in to comment.