explicit aha_iterator(ContT* array, size_t offset)
: aha_(array)
, offset_(offset)
- {
- advancePastEmpty();
- }
+ {}
// Returns unique index that can be used with findAt().
// WARNING: The following function will fail silently for hashtable
// with capacity > 2^32
uint32_t getIndex() const { return offset_; }
+ void advancePastEmpty() {
+ while (offset_ < aha_->capacity_ && !isValid()) {
+ ++offset_;
+ }
+ }
+
private:
friend class AtomicHashArray;
friend class boost::iterator_core_access;
return aha_->cells_[offset_];
}
- void advancePastEmpty() {
- while (offset_ < aha_->capacity_ && !isValid()) {
- ++offset_;
- }
- }
-
bool isValid() const {
KeyT key = acquireLoadKey(aha_->cells_[offset_]);
return key != aha_->kEmptyKey_ &&