mirror of git://gcc.gnu.org/git/gcc.git
This patch adds support for constructing and assigning tuple<> from other empty tuple-like types (e.g., array<T, 0>), completing the C++23 tuple-like interface for the zero-element tuple specialization. The implementation includes: - Constructor from forwarding reference to tuple-like types - Allocator-aware constructor from tuple-like types - Assignment operator from tuple-like types - Const assignment operator from tuple-like types PR libstdc++/119721 libstdc++-v3/ChangeLog: * include/std/tuple (tuple<>::tuple(const tuple&)) (tuple<>::operator=(const tuple&)): Define as defaulted. (tuple<>::swap): Moved the defintion after assignments. (tuple<>::tuple(_UTuple&&)) (tuple<>::tuple(allocator_arg_t, const _Alloc&, _UTuple&&)) (tuple<>::operator=(_UTuple&&)) [__cpp_lib_tuple_like]: Define. (tuple<>::operator==, tuple<>::opeator<=>): Parenthesize constrains individually. * testsuite/23_containers/tuple/cons/119721.cc: New test for constructors and assignments with empty tuple-like types. * testsuite/20_util/tuple/requirements/empty_trivial.cc: New test verifying tuple<> remains trivially copyable. Reviewed-by: Jonathan Wakely <jwakely@redhat.com> Co-authored-by: Tomasz Kamiński <tkaminsk@redhat.com> Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com> |
||
|---|---|---|
| .. | ||
| apply | ||
| comparison_operators | ||
| cons | ||
| creation_functions | ||
| element_access | ||
| make_from_tuple | ||
| requirements | ||
| 48476.cc | ||
| 51365.cc | ||
| 53648.cc | ||
| 56785.cc | ||
| 60497.cc | ||
| 61947.cc | ||
| 67844.cc | ||
| 77395.cc | ||
| 77802.cc | ||
| 78939.cc | ||
| 116440.C | ||
| constexpr_swap.cc | ||
| cv_tuple_element.cc | ||
| cv_tuple_size.cc | ||
| cv_tuple_size_neg.cc | ||
| dangling_ref.cc | ||
| dr2729.cc | ||
| dr3528.cc | ||
| moveable.cc | ||
| moveable2.cc | ||
| noexcept_move_assign.cc | ||
| noexcept_swap.cc | ||
| p2165r4.cc | ||
| p2321r2.cc | ||
| swap.cc | ||
| swap_cxx17.cc | ||
| tuple_element.cc | ||
| tuple_element_t.cc | ||
| tuple_like_ftm.cc | ||
| tuple_size.cc | ||
| tuple_size_v.cc | ||