Override TemporaryFile's default move constructor
[folly.git] / folly / experimental / StringKeyedUnorderedMap.h
index fe2fb4111c45f141a3b1050ceca86198f213abb0..4cf33b434fa3f292255282020703bbe2d0cd27d7 100644 (file)
@@ -24,9 +24,9 @@
 #include <unordered_map>
 #include <utility>
 
-#include <folly/Hash.h>
 #include <folly/Range.h>
 #include <folly/experimental/StringKeyedCommon.h>
+#include <folly/hash/Hash.h>
 
 namespace folly {
 
@@ -47,7 +47,7 @@ class StringKeyedUnorderedMap
  private:
   using Base = std::unordered_map<StringPiece, Value, Hash, Eq, Alloc>;
 
-public:
+ public:
   typedef typename Base::key_type key_type;
   typedef typename Base::mapped_type mapped_type;
   typedef typename Base::value_type value_type;
@@ -151,11 +151,16 @@ public:
   using Base::cbegin;
   using Base::cend;
 
-  bool operator==(const StringKeyedUnorderedMap& rhs) {
-    const Base& lhs = *this;
+  bool operator==(StringKeyedUnorderedMap const& other) const {
+    Base const& lhs = *this;
+    Base const& rhs = static_cast<Base const&>(other);
     return lhs == rhs;
   }
 
+  void swap(StringKeyedUnorderedMap& other) & {
+    return Base::swap(other);
+  }
+
   // No need for copy/move overload as StringPiece is small struct.
   mapped_type& operator[](StringPiece key) {
     auto it = find(key);
@@ -231,4 +236,4 @@ public:
   }
 };
 
-} // folly
+} // namespace folly