Documentation Home >> Headers >> <jss/concurrent_map.hpp> Header >> jss::concurrent_map >> erase member function

Construct a new key-value pair from the specified key and data. If there is no key-value pair associated with the specified key in a given jss::concurrent_map object, insert the new one, otherwise replace the existing entry with the new one.

iterator erase(const iterator& it);
iterator erase(iterator&& it);
void erase(KeyType && key);

Requirements:

it must refer to an item in *this.

Effects:

Remove the key-value pair referred to by it or with the specified key from *this.

If an entry is removed then the old entry is destroyed when there is no longer any accesses to the map object that could reference it.

Returns:

The overloads that take iterators return a new iterator referring to the key-value pair following it at the point of call, or this->end() if there is no such value.

Throws:

Any exception thrown by the application of the Hasher or KeyEquals objects.

Synchronization:

erase() may be called concurrently with any other member function of jss::concurrent_map on a given instance (except for the constructor and destructor) without external synchronization.

Header

#include <jss/concurrent_map.hpp>

See Also