Title
Moves improperly defined as deleted
Status
c++20
Section
[pairs.pair][tuple.assign]
Submitter
Casey Carter

Created on 2017-05-05.00:00:00 last changed 38 months ago

Messages

Date: 2017-11-10.03:05:33

Proposed resolution:

This wording is relative to N4659.

  1. Edit [pairs.pair] as indicated:

    pair& operator=(pair&& p) noexcept(see below);
    

    -21- Effects: Assigns to first with std::forward<first_type>(p.first) and to second with std::forward<second_type>(p.second).

    -22- Remarks: This operator shall be defined as deletednot participate in overload resolution unless is_move_assignable_v<first_type> is true and is_move_assignable_v<second_type> is true.

    […]

  2. Edit [tuple.assign] as indicated:

    tuple& operator=(tuple&& u) noexcept(see below);
    

    -5- Effects: For all i, assigns std::forward<Ti>(get<i>(u)) to get<i>(*this).

    -6- Remarks: This operator shall be defined as deletednot participate in overload resolution unless is_move_assignable_v<Ti> is true for all i.

    […]

Date: 2017-11-11.01:14:27

[ 2017-11 Albuquerque Wednesday issue processing ]

Move to Immediate

Date: 2017-07-15.22:58:07

[ 2017-07 Toronto Wed Issue Prioritization ]

Priority 2

Date: 2017-05-05.00:00:00

LWG 2729 constrained many pair & tuple assignment operators to "not participate in overload resolution" and "be defined as deleted if." As discussed when LWG reviewed 2756, it is undesirable to require that a move constructor or assignment operator be "defined as deleted," since it is unclear whether that operation should be implicitly deleted, and therefore not participate in overload resolution, or explicitly deleted and therefore impede overload resolution for usages that would otherwise find copies.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2017-11-13 19:01:36adminsetstatus: immediate -> wp
2017-11-11 01:14:27adminsetstatus: ready -> immediate
2017-11-10 03:05:33adminsetmessages: + msg9539
2017-11-10 03:05:33adminsetstatus: new -> ready
2017-07-15 22:58:07adminsetmessages: + msg9383
2017-05-07 16:55:02adminsetmessages: + msg9173
2017-05-05 00:00:00admincreate