Fix HHWheelTimer compilation bug in libc++ build
[folly.git] / folly / AtomicHashMap.h
index 33ab11c9f0249ccf20488af9d7cc2d3ef636390e..a5352b007eeedaa822803ab214287bf3c6c45046 100644 (file)
 #include <functional>
 #include <atomic>
 
-#include "folly/AtomicHashArray.h"
-#include "folly/Foreach.h"
-#include "folly/Hash.h"
-#include "folly/Likely.h"
-#include "folly/ThreadCachedInt.h"
+#include <folly/AtomicHashArray.h>
+#include <folly/Foreach.h>
+#include <folly/Hash.h>
+#include <folly/Likely.h>
+#include <folly/ThreadCachedInt.h>
 
 namespace folly {
 
@@ -318,17 +318,21 @@ class AtomicHashMap : boost::noncopyable {
   }
 
   iterator begin() {
-    return iterator(this, 0,
+    iterator it(this, 0,
       subMaps_[0].load(std::memory_order_relaxed)->begin());
-  }
-
-  iterator end() {
-    return iterator();
+    it.checkAdvanceToNextSubmap();
+    return it;
   }
 
   const_iterator begin() const {
-    return const_iterator(this, 0,
+    const_iterator it(this, 0,
       subMaps_[0].load(std::memory_order_relaxed)->begin());
+    it.checkAdvanceToNextSubmap();
+    return it;
+  }
+
+  iterator end() {
+    return iterator();
   }
 
   const_iterator end() const {
@@ -410,6 +414,6 @@ class AtomicHashMap : boost::noncopyable {
 
 } // namespace folly
 
-#include "AtomicHashMap-inl.h"
+#include <folly/AtomicHashMap-inl.h>
 
 #endif // FOLLY_ATOMICHASHMAP_H_