From 075808007c5d1deae43f22fbe3f28347192f4758 Mon Sep 17 00:00:00 2001 From: Peter Griess Date: Fri, 31 Jan 2014 12:21:15 -0800 Subject: [PATCH] Specialize hash in correct namespaces Summary: - Use the BOOST_STD_EXTENSION_NAMESPACE macro to pick the namespace to use for hash specializations Test Plan: - fbconfig -r unicorn/utils/ && fbmake opt - fbconfig -r folly && fbmake runtests - Build in fbobjc with libc++ @override-unit-failures Reviewed By: rajatr@fb.com FB internal diff: D1153422 Blame Revision: D1152140 --- folly/String.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/folly/String.h b/folly/String.h index b7a05f1c..bea17b72 100644 --- a/folly/String.h +++ b/folly/String.h @@ -21,6 +21,11 @@ #include #include +#ifdef _GLIBCXX_SYMVER +#include +#include +#endif + #include #include @@ -491,7 +496,10 @@ std::string join(const Delim& delimiter, } // namespace folly // Hash functions for string and fbstring usable with e.g. hash_map -FOLLY_NAMESPACE_STD_BEGIN +// +// We let Boost pick the namespace here for us, since it has logic to do the +// right thing based on the C++ standard library implementation being used. +namespace BOOST_STD_EXTENSION_NAMESPACE { template struct hash > : private hash { @@ -507,7 +515,7 @@ struct hash > : private hash { } }; -FOLLY_NAMESPACE_STD_END +} // Hook into boost's type traits namespace boost { -- 2.34.1