aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-11-01 14:17:38 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2024-11-13 20:21:39 +0000
commit37b17388fca498cff718a13aa8d4523f15427c8c (patch)
treeadf1b05c47e1217abcbcef0eaddf2a7f73a97451 /libcpp
parent73676cfb201e988bc086a8aeb63223f66f7b6252 (diff)
downloadgcc-37b17388fca498cff718a13aa8d4523f15427c8c.zip
gcc-37b17388fca498cff718a13aa8d4523f15427c8c.tar.gz
gcc-37b17388fca498cff718a13aa8d4523f15427c8c.tar.bz2
libstdc++: Add _Hashtable::_M_assign for the common case
This adds a convenient _M_assign overload for the common case where the node generator is the _AllocNode type. Only two places need to call _M_assign with a _ReuseOrAllocNode node generator, so all the other calls to _M_assign can use the new overload instead of manually constructing a node generator. The _AllocNode::operator(Args&&...) function doesn't need to be a variadic template. It is only ever called with a single argument of type const value_type& or value_type&&, so could be simplified. That isn't done in this commit. libstdc++-v3/ChangeLog: * include/bits/hashtable.h (_Hashtable): Remove typedefs for node generators. (_Hashtable::_M_assign(_Ht&&)): Add new overload. (_Hashtable::operator=(initializer_list<value_type>)): Add local typedef for node generator. (_Hashtable::_M_assign_elements): Likewise. (_Hashtable::operator=(const _Hashtable&)): Use new _M_assign overload. (_Hashtable(const _Hashtable&)): Likewise. (_Hashtable(const _Hashtable&, const allocator_type&)): Likewise. (_Hashtable(_Hashtable&&, __node_alloc_type&&, false_type)): Likewise. * include/bits/hashtable_policy.h (_Insert): Remove typedef for node generator. Reviewed-by: François Dumont <fdumont@gcc.gnu.org>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions