Swapping non-swappable types and LWG 2749, swappable traits for variants. * include/bits/move.h (swap(_Tp&, _Tp&)): Constrain with __is_tuple_like. * include/bits/stl_pair.h (swap(pair<_T1, _T2>&, pair<_T1, _T2>&)): Add a deleted overload. * include/bits/unique_ptr.h (swap(unique_ptr<_Tp, _Dp>&, unique_ptr<_Tp, _Dp>&)): Likewise. * include/std/array (swap(array<_Tp, _Nm>&, array<_Tp, _Nm>&)): Likewise. * include/std/optional (swap(optional<_Tp>&, optional<_Tp>&)): Likewise. * include/std/tuple (__is_tuple_like_impl, __is_tuple_like): Move to type_traits. (swap(tuple<_Elements...>&, tuple<_Elements...>&)): Add a deleted overload. * include/std/type_traits (__is_tuple_like_impl, __is_tuple_like): New. (swap(_Tp&, _Tp&)): Constrain with __is_tuple_like. * include/std/utility (__is_tuple_like_impl): Move to type_traits. * include/std/variant (swap(variant<_Types...>&, variant<_Types...>&)): Add a deleted overload. * testsuite/20_util/optional/swap/2.cc: Add tests for disabled swaps. * testsuite/20_util/pair/swap_cxx17.cc: New. * testsuite/20_util/tuple/swap_cxx17.cc: Likewise. * testsuite/20_util/unique_ptr/specialized_algorithms/swap_cxx17.cc: Likewise. * testsuite/20_util/variant/compile.cc: Add tests for disabled swaps. * testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc: New. * testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust. * testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc: Likewise. From-SVN: r243120
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| apply | Loading commit data... | |
| comparison_operators | Loading commit data... | |
| cons | Loading commit data... | |
| creation_functions | Loading commit data... | |
| element_access | Loading commit data... | |
| make_from_tuple | Loading commit data... | |
| requirements | Loading commit data... | |
| 48476.cc | Loading commit data... | |
| 51365.cc | Loading commit data... | |
| 53648.cc | Loading commit data... | |
| 56785.cc | Loading commit data... | |
| 60497.cc | Loading commit data... | |
| 61947.cc | Loading commit data... | |
| 67844.cc | Loading commit data... | |
| 77395.cc | Loading commit data... | |
| 77802.cc | Loading commit data... | |
| cv_tuple_element.cc | Loading commit data... | |
| cv_tuple_size.cc | Loading commit data... | |
| moveable.cc | Loading commit data... | |
| moveable2.cc | Loading commit data... | |
| noexcept_move_assign.cc | Loading commit data... | |
| noexcept_swap.cc | Loading commit data... | |
| swap.cc | Loading commit data... | |
| swap_cxx17.cc | Loading commit data... | |
| tuple_element.cc | Loading commit data... | |
| tuple_element_t.cc | Loading commit data... | |
| tuple_size.cc | Loading commit data... | |
| tuple_size_v.cc | Loading commit data... |