This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++14 status.
Assignable
" requirementSection: 26.8.5 [alg.partitions] Status: C++14 Submitter: Daniel Krügler Opened: 2014-02-01 Last modified: 2017-07-05
Priority: 0
View all other issues in [alg.partitions].
View all issues with C++14 status.
Discussion:
The Requires element of partition_copy
says (emphasis mine):
Requires:
InputIterator
's value type shall beAssignable
, and …
The C++03 term Assignable
was replaced by CopyAssignable
, remaining cleanups happened via LWG issue
972(i), 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(i).
CopyAssignable
is needed here, given the fact that we already require "writable to" an
OutputIterator
which is defined in 24.3.1 [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.
[Issaquah 2014-02-11: Move to Immediate]
Proposed resolution:
This wording is relative to N3797.
Modify 26.8.5 [alg.partitions], p12 as indicated:
-12- Requires:
InputIterator
's value type shall beCopyAssignable
, and shall be writable to theout_true
andout_false
OutputIterator
s, and shall be convertible toPredicate
's argument type. The input range shall not overlap with either of the output ranges.