901. insert iterators can move from lvalues

Section: 27.5.2.5 [insert.iterator] Status: NAD Submitter: Alisdair Meredith Opened: 2008-09-24 Last modified: 2016-02-10

Priority: Not Prioritized

View all issues with NAD status.

Discussion:

Addresses UK 282

The requires clause on the const T & overloads in back_insert_iterator/front_insert_iterator/insert_iterator mean that the assignment operator will implicitly move from lvalues of a move-only type.

Suggested resolutions are:

  1. Add another overload with a negative constraint on copy-constructible and flag it "= delete".
  2. Drop the copy-constructible overload entirely and rely on perfect forwarding to catch move issues one level deeper.
  3. This is a fundamental problem in move-syntax that relies on the presence of two overloads, and we need to look more deeply into this area as a whole - do not solve this issue in isolation.

[ Post Summit, Alisdair adds: ]

Both comment and issue have been resolved by the adoption of N2844 (rvalue references safety fix) at the last meeting.

Suggest resolve as NAD Editorial with a reference to the paper.

[ Batavia (2009-05): ]

We agree that this has been resolved in the latest Working Draft. Move to NAD.

Proposed resolution:

Recommend NAD, addressed by N2844.