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