This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3 PATCH] LWG 2766, LWG 2749


The first patch does everything but the container adaptor parts (which
are wrong in the p/r) and the tuple part (which is icky). The second
part does the tuple parts, and needs some serious RFC. I know
it's ugly as sin, but it works. I don't think we should try to teach
our tuple to give the right answer for is_constructible etc., because
the last attempt at it broke boost and would break reasonable existing
code in addition to just boost - such things are not Stage 3 material,
imnsho. We, imho, have two options: either skip the tuple parts
of LWG 2766 or tolerate the ugliness of that second patch. I can
tolerate that ugliness, it's not quite so hideous as I feared.

2016-11-18  Ville Voutilainen  <ville.voutilainen@gmail.com>

    Implement LWG 2766,
    Swapping non-swappable types and LWG 2749,
    swappable traits for variants.
    * 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/variant
    (swap(variant<_Types...>&, variant<_Types...>&)): Likewise.
    * testsuite/20_util/optional/swap/2.cc: Add tests for disabled
    swaps.
    * testsuite/20_util/pair/swap_cxx17.cc: New.
    * 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.

2016-11-18  Ville Voutilainen  <ville.voutilainen@gmail.com>

    Implement LWG 2766 for tuple.
    * include/bits/move.h (swap(_Tp&, _Tp&)): Constrain
    with __is_tuple_like.
    * 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.
    * testsuite/20_util/tuple/swap_cxx17.cc: New.

Attachment: lwg2766.diff
Description: Text document

Attachment: lwg2766_ugly.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]