]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Access std::pair members without tuple-like helpers
authorJonathan Wakely <jwakely@redhat.com>
Fri, 8 Oct 2021 12:41:19 +0000 (13:41 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 8 Oct 2021 23:57:47 +0000 (00:57 +0100)
commitd87105d697ced10e1f7af3f1f80ef6c9890c8585
tree90db83e14b835e7f1fdb571c052700404e0eb9e0
parent64acc43de1e33616e43b239887a260eb4a51fcc7
libstdc++: Access std::pair members without tuple-like helpers

This avoids the tuple-like API for std::pair in the unordered
containers, removing some overly generic code.

The _Select1st projection can figure out the member types of a std::pair
without using decltype(std::get<0>(...)).

We don't need _Select2nd because it's only needed in
_NodeBuilder::_S_build, and that can just access the .second member of
the pair directly. The return type of that function doesn't need to be
deduced by decltype, we can just expose the __node_type typedef of the
node generator.

libstdc++-v3/ChangeLog:

* include/bits/hashtable_policy.h (_Select1st): Replace use of
std::get.
(_Select2nd): Remove.
(_NodeBuilder::_S_build): Use _NodeGenerator::__node_type
typedef instead of deducing it. Remove unnecessary piecewise
construction.
(_ReuseOrAllocNode): Make __node_type public.
(_Map_base): Adjust partial specialization to be able to extract
the mapped_type without using tuple_element.
(_Map_base::at): Define inline
* testsuite/23_containers/unordered_map/requirements/53339.cc:
Remove XFAIL.
* testsuite/23_containers/unordered_multimap/requirements/53339.cc:
Likewise.
libstdc++-v3/include/bits/hashtable_policy.h
libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53339.cc
libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/53339.cc
This page took 0.060566 seconds and 6 git commands to generate.