https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117402

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathan Myers <[email protected]>:

https://gcc.gnu.org/g:94d5ca4583876ca0fd2978b24f1fbc93a53b8373

commit r16-7889-g94d5ca4583876ca0fd2978b24f1fbc93a53b8373
Author: Nathan Myers <[email protected]>
Date:   Mon Jan 12 22:49:59 2026 -0500

    libstdc++: container heterogeneous insertion (P2363) [PR117402]

    Implements P2353R5 "Extending associative containers with the
    remaining heterogeneous overloads". Adds overloads templated on
    heterogeneous key types for several members of associative
    containers, particularly insertions:

                          /-- unordered --\
     set  map  mset mmap set  map  mset mmap
      @    .    .    .    @    .    .    .    insert
      .    @    .    .    .    @    .    .    op[], at, try_emplace,
                                                insert_or_assign
      .    .    .    .    @    @    @    @    bucket

    (Nothing is added to the multiset or multimap tree containers.)
    All the insert*() and try_emplace() members also get a hinted
    overload.  The at() members get const and non-const overloads.

    The new overloads enforce concept __heterogeneous_tree_key or
    __heterogeneous_hash_key, as in P2077, to enforce that the
    function objects provided meet requirements, and that the key
    supplied is not an iterator or the native key. Insertions
    implicitly construct the required key_type object from the
    argument, by move where permitted.

    libstdc++-v3/ChangeLog:
            PR libstdc++/117402
            * include/bits/stl_map.h (operator[], at (2x), try_emplace (2x),
            insert_or_assign (2x)): Add overloads.
            * include/bits/unordered_map.h (operator[], at (2x),
            try_emplace (2x), insert_or_assign (2x), bucket (2x)): Add
overloads.
            * include/bits/stl_set.h (insert (2x)): Add overloads.
            * include/bits/unordered_set.h (insert (2x), bucket (2x)): Add
overloads.
            * include/bits/hashtable.h (_M_bucket_tr, _M_insert_tr): Define.
            * include/bits/hashtable_policy.h (_M_at_tr (2x)): Define.
            * include/bits/stl_tree.h (_M_emplace_here,
_M_get_insert_unique_pos_tr,
            _M_get_insert_hint_unique_pos_tr): Define new heterogeneous
insertion
            code path for set and map.
            * include/bits/version.def (associative_heterogeneous_insertion):
            Define.
            * include/bits/version.h: Regenerate.
            * include/std/map
(__glibcxx_want_associative_heterogeneous_insertion):
            Define macro.
            * include/std/set: Same.
            * include/std/unordered_map: Same.
            * include/std/unordered_set: Same.
            * testsuite/23_containers/map/modifiers/hetero/insert.cc: New
tests.
            * testsuite/23_containers/set/modifiers/hetero/insert.cc: Same.
            * testsuite/23_containers/unordered_map/modifiers/hetero/insert.cc:
            Same.
            *
testsuite/23_containers/unordered_multimap/modifiers/hetero/insert.cc:
            Same.
            *
testsuite/23_containers/unordered_multiset/modifiers/hetero/insert.cc:
            Same.
            * testsuite/23_containers/unordered_set/modifiers/hetero/insert.cc:
            Same.

Reply via email to