Title
Remaining "Assignable" requirement
Status
c++14
Section
[alg.partitions]
Submitter
Daniel Krügler

Created on 2014-02-01.00:00:00 last changed 130 months ago

Messages

Date: 2014-02-13.06:35:03

Proposed resolution:

This wording is relative to N3797.

  1. Modify [alg.partitions], p12 as indicated:

    -12- Requires: InputIterator's value type shall be CopyAssignable, and shall be writable to the out_true and out_false OutputIterators, and shall be convertible to Predicate's argument type. The input range shall not overlap with either of the output ranges.

Date: 2014-02-13.06:35:03

[ Issaquah 2014-02-11: Move to Immediate ]

Date: 2014-02-01.00:00:00

The Requires element of partition_copy says (emphasis mine):

Requires: InputIterator's value type shall be Assignable, and …

The C++03 term Assignable was replaced by CopyAssignable, remaining cleanups happened via LWG issue 972, but algorithm partition_copy was not affected at that time (during that time the requirements of partition_copy didn't mention writable nor assignable, but I cannot track down at the moment where these requirements had been added). Presumably this requirement should be corrected similarly to the approach used in 972.

Another question is whether a CopyAssignable is needed here, given the fact that we already require "writable to" an OutputIterator which is defined in [iterator.requirements.general] and does already impose the necessary statement

*out = *in;

Given the fact that partition_copy never touches any input value twice, there is no reason why anything more than writable to should be necessary.

The below suggested primary resolution does not respond to the second part of this question.

History
Date User Action Args
2014-02-27 17:03:20adminsetstatus: wp -> c++14
2014-02-20 13:52:38adminsetstatus: immediate -> wp
2014-02-13 06:35:03adminsetmessages: + msg6838
2014-02-13 06:35:03adminsetstatus: new -> immediate
2014-02-01 20:28:34adminsetmessages: + msg6803
2014-02-01 00:00:00admincreate