Revert D6050464: [Folly] Move folly/Hash.h to folly/hash/
[folly.git] / folly / experimental / StringKeyedUnorderedMap.h
index c67b9089f066b05beeafcf64b21692205da89c75..41180cb771c9ce3ac0ba49235db78d5686a59310 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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