This is an archive of the discontinued LLVM Phabricator instance.

unordered_map: Use __hash_table::__emplace_unique(), NFC
AbandonedPublic

Authored by dexonsmith on Feb 1 2016, 5:43 PM.

Details

Reviewers
None
Summary

Instead of duplicating code in unordered_map::emplace(), use
hash_table::emplace_unique().

Diff Detail

Event Timeline

dexonsmith updated this revision to Diff 46602.Feb 1 2016, 5:43 PM
dexonsmith retitled this revision from to unordered_map: Use __hash_table::__emplace_unique(), NFC.
dexonsmith updated this object.
dexonsmith added a reviewer: EricWF.
dexonsmith added a subscriber: cfe-commits.
EricWF edited edge metadata.Feb 6 2016, 1:28 PM

This is very subtly broken. The requirements in the standard for emplace are

[unord.req] Table 102

a_eq.emplace(args)
Requires: : value_type shall be EmplaceConstructible into X from args.

Unfortunately __hash_table doesn't know that unordered_map has this "special" value_type, so it can't actually extract and construct the correct value_type from it. I'm going to change
this over the weekend. Once I've done some prep work this patch should be ready to go.

All of the prep work has landed. This patch is no longer needed though.

EricWF resigned from this revision.Apr 15 2016, 6:28 PM
EricWF removed a reviewer: EricWF.

I think this has been landed (or is no longer relevent) after all of the recent changes.

dexonsmith abandoned this revision.Oct 6 2020, 2:59 PM