// Handle interaction with different C++ standard libraries, which
// expect these types to be in different namespaces.
-#define FOLLY_FBSTRING_HASH1(T) \
- template <> \
- struct hash< ::folly::basic_fbstring<T> > { \
- size_t operator()(const ::folly::basic_fbstring<T>& s) const { \
- return ::folly::hash::fnv32_buf(s.data(), s.size()); \
- } \
+#define FOLLY_FBSTRING_HASH1(T) \
+ template <> \
+ struct hash<::folly::basic_fbstring<T>> { \
+ size_t operator()(const ::folly::basic_fbstring<T>& s) const { \
+ return ::folly::hash::fnv32_buf(s.data(), s.size() * sizeof(T)); \
+ } \
};
// The C++11 standard says that these four are defined
#if FOLLY_HAVE_WCHAR_SUPPORT
TEST(FBString, testHashChar16) {
- using u16fbstring = basic_fbstring<char16_t>;
+ using u16fbstring = folly::basic_fbstring<char16_t>;
u16fbstring a;
u16fbstring b;
a.push_back(0);