Limit template parameters in hashtable

François Dumont frs.dumont@gmail.com
Tue Jul 23 19:23:00 GMT 2013


On 07/21/2013 07:55 PM, Jonathan Wakely wrote:
> Ah OK. I like this change, I think it should produce smaller code when 
> multiple hash tables are used in the same program. 

Hi

     Before you give the final validation I would like to propose this 
revisited version.

     Now that we have a base class managing allocation we can also use 
it for EBO of the allocator instance. I was not happy with 
_M_before_begin base node being lost in _Hashtable_alloc while all other 
fields were declared in _Hashtable. Use of _Hashtable_ebo_helper will 
also avoid problem if the allocator type is final.

     * include/bits/hashtable_policy.h (_Hashtable_alloc): New.
     (_ReuseOrAllocNode, _AllocNode): Adapt to use latter rather than
     _Hashtable.
     * include/bits/hashtable.h (_Hashtable): Inherit from
     _Hashtable_alloc and adapt.
     * testsuite/23_containers/unordered_set/
     not_default_constructible_hash_neg.cc: Adapt dg-error line number.
     * testsuite/23_containers/unordered_set/instantiation_neg.cc:
     Likewise.

Tested under Linux x86_64.

Ok to commit ?

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hashtable.patch
Type: text/x-patch
Size: 40117 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20130723/f7c6f29a/attachment.bin>


More information about the Libstdc++ mailing list