{"id":2226187,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2226187/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.8@forge-stage.sourceware.org/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.8@forge-stage.sourceware.org>","date":"2026-04-22T10:25:17","name":"[v1,08/12] libstdc++: Remove _Insert base class from _Hashtable","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"72e7f09bbeeac9af2459f117fea15191192ad24c","submitter":{"id":93210,"url":"http://patchwork.ozlabs.org/api/1.1/people/93210/?format=json","name":"Jonathan Wakely via Sourceware Forge","email":"forge-bot+redi@forge-stage.sourceware.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.8@forge-stage.sourceware.org/mbox/","series":[{"id":500966,"url":"http://patchwork.ozlabs.org/api/1.1/series/500966/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=500966","date":"2026-04-22T10:25:11","name":"WIP: libstdc++: Refactor hash table code","version":1,"mbox":"http://patchwork.ozlabs.org/series/500966/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226187/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226187/checks/","tags":{},"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org","sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org","server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wYL0qr2z1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:33:26 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 93E524422AA2\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:33:23 +0000 (GMT)","from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id DA3914BBCDA3\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:26:17 +0000 (GMT)","from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 22ECA405A7\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:26:15 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 93E524422AA2","OpenDKIM Filter v2.11.0 sourceware.org DA3914BBCDA3"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org DA3914BBCDA3","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org DA3914BBCDA3","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776853577; cv=none;\n b=CTAd20SISvnxAT5wZbHq8ZIS+y7BD6/x9GphVPDxdXJ64h/Fv9g1iqWsNhdRvJF0ymXyc/WRAYcWk0o1nir0hKc+pN0odQxnC9i4sek9HwL5qh6D2kNF6QyCghxpKH/gUGSD+6TNDy/TvsMlZa5xeuMqd5x+deIpPuE7W5AcBp0=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776853577; c=relaxed/simple;\n bh=xwYSJ3VY1ZqqBM6nsb3mz+ffyO23J1qJgGDptpN5bqg=;\n h=From:Date:Subject:MIME-Version:To:Message-ID;\n b=eWlT9l3NMxaxC5+m3msz5myW2tjUG79/n/JwVnRDd2fQOTXEYHa2q0x8IO/TxbltZ7/xxN+61lv8VZ12wNmGRYfnorpO2vG7WZkjWMFXDEf6cdWSN5Qu+hNN/0TsDgw2K7uaFmaP0GzfN73nQEZEq9muk4jdzlIaOjw6pepNfy8=","ARC-Authentication-Results":"i=1; server2.sourceware.org","From":"Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>","Date":"Wed, 22 Apr 2026 10:25:17 +0000","Subject":"[PATCH v1 08/12] libstdc++: Remove _Insert base class from _Hashtable","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>","Message-ID":"\n <bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.8@forge-stage.sourceware.org>","X-Mailer":"batrachomyomachia","X-Requested-Reviewer":"fdumont","X-Pull-Request-Organization":"gcc","X-Pull-Request-Repository":"gcc-TEST","X-Pull-Request":"https://forge.sourceware.org/gcc/gcc-TEST/pulls/15","References":"\n <bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.0@forge-stage.sourceware.org>","In-Reply-To":"\n <bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.0@forge-stage.sourceware.org>","X-Patch-URL":"\n https://forge.sourceware.org/redi/gcc/commit/a7225614144142b964ab2d2681332f0a1025cb6e","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Reply-To":"gcc-patches mailing list <gcc-patches@gcc.gnu.org>, redi@gcc.gnu.org","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"From: Jonathan Wakely <jwakely@redhat.com>\n\nThere's no reason to have a separate base class defining the insert\nmember functions now. They can all be moved into the _Hashtable class,\nwhich simplifies them slightly.\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/bits/hashtable.h (_Hashtable): Remove inheritance from\n\t__detail::_Insert and move its members into _Hashtable.\n\t* include/bits/hashtable_policy.h (__detail::_Insert): Remove.\n\nReviewed-by: François Dumont <fdumont@gcc.gnu.org>\n---\n libstdc++-v3/include/bits/hashtable.h        | 164 ++++++++++++++--\n libstdc++-v3/include/bits/hashtable_policy.h | 195 -------------------\n 2 files changed, 144 insertions(+), 215 deletions(-)","diff":"diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h\nindex a46a94e2ecd5..9db568a1f633 100644\n--- a/libstdc++-v3/include/bits/hashtable.h\n+++ b/libstdc++-v3/include/bits/hashtable.h\n@@ -169,7 +169,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n    *\n    *  Functionality is implemented by decomposition into base classes,\n    *  where the derived _Hashtable class is used in _Map_base,\n-   *  _Insert, _Rehash_base, and _Equality base classes to access the\n+   *  _Rehash_base, and _Equality base classes to access the\n    *  \"this\" pointer. _Hashtable_base is used in the base classes as a\n    *  non-recursive, fully-completed-type so that detailed nested type\n    *  information, such as iterator type and node type, can be\n@@ -180,7 +180,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n    *  Base class templates are:\n    *    - __detail::_Hashtable_base\n    *    - __detail::_Map_base\n-   *    - __detail::_Insert\n    *    - __detail::_Rehash_base\n    *    - __detail::_Equality\n    */\n@@ -194,9 +193,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n       public __detail::_Map_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,\n \t\t\t\t _Hash, _RangeHash, _Unused,\n \t\t\t\t _RehashPolicy, _Traits>,\n-      public __detail::_Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal,\n-\t\t\t       _Hash, _RangeHash, _Unused,\n-\t\t\t       _RehashPolicy, _Traits>,\n       public __detail::_Rehash_base<_Key, _Value, _Alloc, _ExtractKey, _Equal,\n \t\t\t\t    _Hash, _RangeHash, _Unused,\n \t\t\t\t    _RehashPolicy, _Traits>,\n@@ -237,10 +233,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n       using __node_base_ptr = typename __hashtable_alloc::__node_base_ptr;\n       using __buckets_ptr = typename __hashtable_alloc::__buckets_ptr;\n \n-      using __insert_base = __detail::_Insert<_Key, _Value, _Alloc, _ExtractKey,\n-\t\t\t\t\t      _Equal, _Hash,\n-\t\t\t\t\t      _RangeHash, _Unused,\n-\t\t\t\t\t      _RehashPolicy, _Traits>;\n       using __enable_default_ctor\n \t= _Hashtable_enable_default_ctor<_Equal, _Hash, _Alloc>;\n       using __rehash_guard_t\n@@ -259,9 +251,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n       typedef value_type&\t\t\t\t\treference;\n       typedef const value_type&\t\t\t\t\tconst_reference;\n \n-      using iterator = typename __insert_base::iterator;\n+      using iterator\n+\t= __detail::_Node_iterator<_Value, __constant_iterators::value,\n+\t\t\t\t   __hash_cached::value>;\n \n-      using const_iterator = typename __insert_base::const_iterator;\n+      using const_iterator\n+\t= __detail::_Node_const_iterator<_Value, __constant_iterators::value,\n+\t\t\t\t\t __hash_cached::value>;\n \n       using local_iterator = __detail::_Local_iterator<key_type, _Value,\n \t\t\t_ExtractKey, _Hash, _RangeHash, _Unused,\n@@ -284,7 +280,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \n       using __hash_code_base =  typename __hashtable_base::__hash_code_base;\n       using __hash_code =  typename __hashtable_base::__hash_code;\n-      using __ireturn_type = typename __insert_base::__ireturn_type;\n+      using __ireturn_type = __conditional_t<__unique_keys::value,\n+\t\t\t\t\t     std::pair<iterator, bool>,\n+\t\t\t\t\t     iterator>;\n \n       using __map_base = __detail::_Map_base<_Key, _Value, _Alloc, _ExtractKey,\n \t\t\t\t\t     _Equal, _Hash, _RangeHash, _Unused,\n@@ -355,12 +353,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \t       bool _Unique_keysa>\n \tfriend struct __detail::_Map_base;\n \n-      template<typename _Keya, typename _Valuea, typename _Alloca,\n-\t       typename _ExtractKeya, typename _Equala,\n-\t       typename _Hasha, typename _RangeHasha, typename _Unuseda,\n-\t       typename _RehashPolicya, typename _Traitsa>\n-\tfriend struct __detail::_Insert;\n-\n       template<typename _Keya, typename _Valuea, typename _Alloca,\n \t       typename _ExtractKeya, typename _Equala,\n \t       typename _Hasha, typename _RangeHasha, typename _Unuseda,\n@@ -957,6 +949,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n       iterator\n       _M_erase(size_type __bkt, __node_base_ptr __prev_n, __node_ptr __n);\n \n+      template<typename _InputIterator>\n+\tvoid\n+\t_M_insert_range_multi(_InputIterator __first, _InputIterator __last);\n+\n     public:\n #pragma GCC diagnostic push\n #pragma GCC diagnostic ignored \"-Wc++17-extensions\" // if constexpr\n@@ -980,9 +976,107 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \t  else\n \t    return _M_emplace_multi(__hint, std::forward<_Args>(__args)...);\n \t}\n-#pragma GCC diagnostic pop\n \n-      // Insert member functions via inheritance.\n+      // Insert\n+      __ireturn_type\n+      insert(const value_type& __v)\n+      {\n+\tif constexpr (__unique_keys::value)\n+\t  return _M_emplace_uniq(__v);\n+\telse\n+\t  return _M_emplace_multi(cend(), __v);\n+      }\n+\n+      iterator\n+      insert(const_iterator __hint, const value_type& __v)\n+      {\n+\tif constexpr (__unique_keys::value)\n+\t  return _M_emplace_uniq(__v).first;\n+\telse\n+\t  return _M_emplace_multi(__hint, __v);\n+      }\n+\n+      __ireturn_type\n+      insert(value_type&& __v)\n+      {\n+\tif constexpr (__unique_keys::value)\n+\t  return _M_emplace_uniq(std::move(__v));\n+\telse\n+\t  return _M_emplace_multi(cend(), std::move(__v));\n+      }\n+\n+      iterator\n+      insert(const_iterator __hint, value_type&& __v)\n+      {\n+\tif constexpr (__unique_keys::value)\n+\t  return _M_emplace_uniq(std::move(__v)).first;\n+\telse\n+\t  return _M_emplace_multi(__hint, std::move(__v));\n+      }\n+\n+#ifdef __glibcxx_unordered_map_try_emplace // C++ >= 17 && HOSTED\n+      template<typename _KType, typename... _Args>\n+\tstd::pair<iterator, bool>\n+\ttry_emplace(const_iterator, _KType&& __k, _Args&&... __args)\n+\t{\n+\t  auto __code = this->_M_hash_code(__k);\n+\t  std::size_t __bkt = _M_bucket_index(__code);\n+\t  if (auto __node = _M_find_node(__bkt, __k, __code))\n+\t    return { iterator(__node), false };\n+\n+\t  _Scoped_node __node {\n+\t    this,\n+\t    std::piecewise_construct,\n+\t    std::forward_as_tuple(std::forward<_KType>(__k)),\n+\t    std::forward_as_tuple(std::forward<_Args>(__args)...)\n+\t  };\n+\t  auto __it = _M_insert_unique_node(__bkt, __code, __node._M_node);\n+\t  __node._M_node = nullptr;\n+\t  return { __it, true };\n+\t}\n+#endif\n+\n+      void\n+      insert(initializer_list<value_type> __l)\n+      { this->insert(__l.begin(), __l.end()); }\n+\n+      template<typename _InputIterator>\n+\tvoid\n+\tinsert(_InputIterator __first, _InputIterator __last)\n+\t{\n+\t  if constexpr (__unique_keys::value)\n+\t    for (; __first != __last; ++__first)\n+\t      _M_emplace_uniq(*__first);\n+\t  else\n+\t    return _M_insert_range_multi(__first, __last);\n+\t}\n+\n+      // This overload is only defined for maps, not sets.\n+      template<typename _Pair,\n+\t       typename = _Require<__not_<is_same<_Key, _Value>>,\n+\t\t\t\t   is_constructible<value_type, _Pair&&>>>\n+\t__ireturn_type\n+\tinsert(_Pair&& __v)\n+\t{\n+\t  if constexpr (__unique_keys::value)\n+\t    return _M_emplace_uniq(std::forward<_Pair>(__v));\n+\t  else\n+\t    return _M_emplace_multi(cend(), std::forward<_Pair>(__v));\n+\t}\n+\n+      // This overload is only defined for maps, not sets.\n+      template<typename _Pair,\n+\t       typename = _Require<__not_<is_same<_Key, _Value>>,\n+\t\t\t\t   is_constructible<value_type, _Pair&&>>>\n+\titerator\n+\tinsert(const_iterator __hint, _Pair&& __v)\n+\t{\n+\t  if constexpr (__unique_keys::value)\n+\t    return _M_emplace_uniq(std::forward<_Pair>(__v));\n+\t  else\n+\t    return _M_emplace_multi(__hint, std::forward<_Pair>(__v));\n+\t}\n+#pragma GCC diagnostic pop\n \n       // Erase\n       iterator\n@@ -2212,6 +2306,36 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \treturn __pos;\n       }\n \n+  template<typename _Key, typename _Value, typename _Alloc,\n+\t   typename _ExtractKey, typename _Equal,\n+\t   typename _Hash, typename _RangeHash, typename _Unused,\n+\t   typename _RehashPolicy, typename _Traits>\n+    template<typename _InputIterator>\n+      void\n+      _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,\n+\t\t _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::\n+      _M_insert_range_multi(_InputIterator __first, _InputIterator __last)\n+      {\n+\tusing __pair_type = std::pair<bool, std::size_t>;\n+\n+\tsize_type __n_elt = __detail::__distance_fw(__first, __last);\n+\tif (__n_elt == 0)\n+\t  return;\n+\n+\t__rehash_guard_t __rehash_guard(_M_rehash_policy);\n+\t__pair_type __do_rehash\n+\t  = _M_rehash_policy._M_need_rehash(_M_bucket_count,\n+\t\t\t\t\t    _M_element_count,\n+\t\t\t\t\t    __n_elt);\n+\n+\tif (__do_rehash.first)\n+\t  _M_rehash(__do_rehash.second, false_type{});\n+\n+\t__rehash_guard._M_guarded_obj = nullptr;\n+\tfor (; __first != __last; ++__first)\n+\t  _M_emplace_multi(cend(), *__first);\n+      }\n+\n   template<typename _Key, typename _Value, typename _Alloc,\n \t   typename _ExtractKey, typename _Equal,\n \t   typename _Hash, typename _RangeHash, typename _Unused,\ndiff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h\nindex cf97e571c1e2..3fd85bff01d5 100644\n--- a/libstdc++-v3/include/bits/hashtable_policy.h\n+++ b/libstdc++-v3/include/bits/hashtable_policy.h\n@@ -947,201 +947,6 @@ namespace __detail\n \t\t_RangeHash, _Unused, _RehashPolicy, _Traits, __uniq>\n     { };\n \n-#pragma GCC diagnostic push\n-#pragma GCC diagnostic ignored \"-Wc++17-extensions\" // if constexpr\n-\n-  // Defines `insert` member functions for _Hashtables.\n-  template<typename _Key, typename _Value, typename _Alloc,\n-\t   typename _ExtractKey, typename _Equal,\n-\t   typename _Hash, typename _RangeHash, typename _Unused,\n-\t   typename _RehashPolicy, typename _Traits>\n-    struct _Insert\n-    {\n-    protected:\n-      using __hashtable_base = _Hashtable_base<_Key, _Value, _ExtractKey,\n-\t\t\t\t\t       _Equal, _Hash, _RangeHash,\n-\t\t\t\t\t       _Unused, _Traits>;\n-\n-      using __hashtable = _Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal,\n-\t\t\t\t     _Hash, _RangeHash,\n-\t\t\t\t     _Unused, _RehashPolicy, _Traits>;\n-\n-      using __hash_cached = typename _Traits::__hash_cached;\n-      using __constant_iterators = typename _Traits::__constant_iterators;\n-\n-      using __hashtable_alloc = _Hashtable_alloc<\n-\t__alloc_rebind<_Alloc, _Hash_node<_Value,\n-\t\t\t\t\t  __hash_cached::value>>>;\n-\n-      using value_type = typename __hashtable_base::value_type;\n-      using size_type = typename __hashtable_base::size_type;\n-\n-      using __unique_keys = typename _Traits::__unique_keys;\n-      using __node_alloc_type = typename __hashtable_alloc::__node_alloc_type;\n-\n-      [[__gnu__::__always_inline__]]\n-      __hashtable&\n-      _M_conjure_hashtable()\n-      { return *(static_cast<__hashtable*>(this)); }\n-\n-      template<typename _InputIterator>\n-\tvoid\n-\t_M_insert_range_multi(_InputIterator __first, _InputIterator __last);\n-\n-    public:\n-      using iterator = _Node_iterator<_Value, __constant_iterators::value,\n-\t\t\t\t      __hash_cached::value>;\n-\n-      using const_iterator = _Node_const_iterator<_Value,\n-\t\t\t\t\t\t  __constant_iterators::value,\n-\t\t\t\t\t\t  __hash_cached::value>;\n-\n-      using __ireturn_type = __conditional_t<__unique_keys::value,\n-\t\t\t\t\t     std::pair<iterator, bool>,\n-\t\t\t\t\t     iterator>;\n-\n-      __ireturn_type\n-      insert(const value_type& __v)\n-      {\n-\t__hashtable& __h = _M_conjure_hashtable();\n-\tif constexpr (__unique_keys::value)\n-\t  return __h._M_emplace_uniq(__v);\n-\telse\n-\t  return __h._M_emplace_multi(__h.cend(), __v);\n-      }\n-\n-      iterator\n-      insert(const_iterator __hint, const value_type& __v)\n-      {\n-\t__hashtable& __h = _M_conjure_hashtable();\n-\tif constexpr (__unique_keys::value)\n-\t  return __h._M_emplace_uniq(__v).first;\n-\telse\n-\t  return __h._M_emplace_multi(__hint, __v);\n-      }\n-\n-      __ireturn_type\n-      insert(value_type&& __v)\n-      {\n-\t__hashtable& __h = _M_conjure_hashtable();\n-\tif constexpr (__unique_keys::value)\n-\t  return __h._M_emplace_uniq(std::move(__v));\n-\telse\n-\t  return __h._M_emplace_multi(__h.cend(), std::move(__v));\n-      }\n-\n-      iterator\n-      insert(const_iterator __hint, value_type&& __v)\n-      {\n-\t__hashtable& __h = _M_conjure_hashtable();\n-\tif constexpr (__unique_keys::value)\n-\t  return __h._M_emplace_uniq(std::move(__v)).first;\n-\telse\n-\t  return __h._M_emplace_multi(__hint, std::move(__v));\n-      }\n-\n-#ifdef __glibcxx_unordered_map_try_emplace // C++ >= 17 && HOSTED\n-      template<typename _KType, typename... _Args>\n-\tstd::pair<iterator, bool>\n-\ttry_emplace(const_iterator, _KType&& __k, _Args&&... __args)\n-\t{\n-\t  __hashtable& __h = _M_conjure_hashtable();\n-\t  auto __code = __h._M_hash_code(__k);\n-\t  std::size_t __bkt = __h._M_bucket_index(__code);\n-\t  if (auto __node = __h._M_find_node(__bkt, __k, __code))\n-\t    return { iterator(__node), false };\n-\n-\t  typename __hashtable::_Scoped_node __node {\n-\t    &__h,\n-\t    std::piecewise_construct,\n-\t    std::forward_as_tuple(std::forward<_KType>(__k)),\n-\t    std::forward_as_tuple(std::forward<_Args>(__args)...)\n-\t    };\n-\t  auto __it\n-\t    = __h._M_insert_unique_node(__bkt, __code, __node._M_node);\n-\t  __node._M_node = nullptr;\n-\t  return { __it, true };\n-\t}\n-#endif\n-\n-      void\n-      insert(initializer_list<value_type> __l)\n-      { this->insert(__l.begin(), __l.end()); }\n-\n-      template<typename _InputIterator>\n-\tvoid\n-\tinsert(_InputIterator __first, _InputIterator __last)\n-\t{\n-\t  __hashtable& __h = _M_conjure_hashtable();\n-\t  if constexpr (__unique_keys::value)\n-\t    for (; __first != __last; ++__first)\n-\t      __h._M_emplace_uniq(*__first);\n-\t  else\n-\t    return _M_insert_range_multi(__first, __last);\n-\t}\n-\n-      // This overload is only defined for maps, not sets.\n-      template<typename _Pair,\n-\t       typename = _Require<__not_<is_same<_Key, _Value>>,\n-\t\t\t\t   is_constructible<value_type, _Pair&&>>>\n-\t__ireturn_type\n-\tinsert(_Pair&& __v)\n-\t{\n-\t  __hashtable& __h = this->_M_conjure_hashtable();\n-\t  if constexpr (__unique_keys::value)\n-\t    return __h._M_emplace_uniq(std::forward<_Pair>(__v));\n-\t  else\n-\t    return __h._M_emplace_multi(__h.cend(), std::forward<_Pair>(__v));\n-\t}\n-\n-      // This overload is only defined for maps, not sets.\n-      template<typename _Pair,\n-\t       typename = _Require<__not_<is_same<_Key, _Value>>,\n-\t\t\t\t   is_constructible<value_type, _Pair&&>>>\n-\titerator\n-\tinsert(const_iterator __hint, _Pair&& __v)\n-\t{\n-\t  __hashtable& __h = this->_M_conjure_hashtable();\n-\t  if constexpr (__unique_keys::value)\n-\t    return __h._M_emplace_uniq(std::forward<_Pair>(__v));\n-\t  else\n-\t    return __h._M_emplace_multi(__hint, std::forward<_Pair>(__v));\n-\t}\n-    };\n-#pragma GCC diagnostic pop\n-\n-  template<typename _Key, typename _Value, typename _Alloc,\n-\t   typename _ExtractKey, typename _Equal,\n-\t   typename _Hash, typename _RangeHash, typename _Unused,\n-\t   typename _RehashPolicy, typename _Traits>\n-    template<typename _InputIterator>\n-      void\n-      _Insert<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash,\n-\t      _Unused, _RehashPolicy, _Traits>::\n-      _M_insert_range_multi(_InputIterator __first, _InputIterator __last)\n-      {\n-\tusing __rehash_guard_t = typename __hashtable::__rehash_guard_t;\n-\tusing __pair_type = std::pair<bool, std::size_t>;\n-\n-\tsize_type __n_elt = __detail::__distance_fw(__first, __last);\n-\tif (__n_elt == 0)\n-\t  return;\n-\n-\t__hashtable& __h = _M_conjure_hashtable();\n-\t__rehash_guard_t __rehash_guard(__h._M_rehash_policy);\n-\t__pair_type __do_rehash\n-\t  = __h._M_rehash_policy._M_need_rehash(__h._M_bucket_count,\n-\t\t\t\t\t\t__h._M_element_count,\n-\t\t\t\t\t\t__n_elt);\n-\n-\tif (__do_rehash.first)\n-\t  __h._M_rehash(__do_rehash.second, false_type{});\n-\n-\t__rehash_guard._M_guarded_obj = nullptr;\n-\tfor (; __first != __last; ++__first)\n-\t  __h._M_emplace_multi(__h.cend(), *__first);\n-      }\n-\n   template<typename _Policy>\n     using __has_load_factor = typename _Policy::__has_load_factor;\n \n","prefixes":["v1","08/12"]}