xenium
Public Member Functions | List of all members
xenium::vyukov_hash_map< Key, Value, Policies >::iterator Class Reference

A ForwardIterator to safely iterate vyukov_hash_map. More...

#include <vyukov_hash_map.hpp>

Public Member Functions

void reset ()
 Releases the bucket lock and resets the iterator. More...
 

Detailed Description

template<class Key, class Value, class... Policies>
class xenium::vyukov_hash_map< Key, Value, Policies >::iterator

A ForwardIterator to safely iterate vyukov_hash_map.

Iterators hold a lock on the currently iterated bucket, blocking concurrent updates (emplace/erase) of that bucket, as well as grow operations or other iterators trying to acquire a lock on that bucket. In order to avoid deadlocks, consider the following guidelines:

Since the bucket locks are exclusive, it is not possible to copy iterators; i.e., copy constructor, copy assignment and postfix increment are not available. Instead, use move construction, move assignment and prefix increment.

Iterators are not invalidated by concurrent update operations.

Member Function Documentation

◆ reset()

template<class Key , class Value , class... Policies>
void xenium::vyukov_hash_map< Key, Value, Policies >::iterator::reset

Releases the bucket lock and resets the iterator.

After calling reset the iterator equals end().