From: Peter Griess Date: Fri, 31 Jan 2014 20:21:15 +0000 (-0800) Subject: Specialize hash in correct namespaces X-Git-Tag: v0.22.0~711 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=075808007c5d1deae43f22fbe3f28347192f4758;p=folly.git 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 --- 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 {