[PATCH] D16792: unordered_map: Use __hash_table::__emplace_unique(), NFC

Duncan P. N. Exon Smith via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 6 15:55:21 PST 2016


> On 2016-Feb-06, at 13:28, Eric Fiselier <eric at efcs.ca> wrote:
> 
> EricWF added a comment.
> 
> 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.

Nice catch.  Even though this "special" value type is what makes
the malloc-optimization so difficult, I missed that behaviour
change here.

Let me know if you run out of time to help with the prep, and I
can take over.  Thanks for helping.

> 
> 
> http://reviews.llvm.org/D16792
> 
> 
> 



More information about the cfe-commits mailing list