Skip to content
Snippets Groups Projects
Unverified Commit 73676cfb authored by Jonathan Wakely's avatar Jonathan Wakely Committed by Jonathan Wakely
Browse files

libstdc++: Refactor Hashtable erasure


This reworks the internal member functions for erasure from
unordered containers, similarly to the earlier commit doing it for
insertion.

Instead of multiple overloads of _M_erase which are selected via tag
dispatching, the erase(const key_type&) member can use 'if constexpr' to
choose an appropriate implementation (returning after erasing a single
element for unique keys, or continuing to erase all equivalent elements
for non-unique keys).

libstdc++-v3/ChangeLog:

	* include/bits/hashtable.h (_Hashtable::_M_erase): Remove
	overloads for erasing by key, moving logic to ...
	(_Hashtable::erase): ... here.

Reviewed-by: default avatarFrançois Dumont <fdumont@gcc.gnu.org>
parent ce2cf1f0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment