Commented: (STDCXX-171) [LWG #538] std::unique_copy() requires CopyConstructible and Assignable

View: New views
1 Messages — Rating Filter:   Alert me  

Commented: (STDCXX-171) [LWG #538] std::unique_copy() requires CopyConstructible and Assignable

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/STDCXX-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706436#action_12706436 ]

Farid Zaripov commented on STDCXX-171:
--------------------------------------

Aren't this issue should be closed as invalid?

{quote}
    \-5\- Requires: The ranges [first, last) and [result, result+(last-first)) shall not overlap. The expression \*result = \*first shall be valid. If neither InputIterator nor OutputIterator meets the requirements of forward iterator then the -value type- +*value_type*+ of InputIterator must be CopyConstructible (20.1.3) +*and Assignable*+. Otherwise CopyConstructible is not required.
{quote}

As I understand, now the value_type of InputIterator must be always Assignable, isn't it?

> [LWG #538] std::unique_copy() requires CopyConstructible and Assignable
> -----------------------------------------------------------------------
>
>                 Key: STDCXX-171
>                 URL: https://issues.apache.org/jira/browse/STDCXX-171
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 25. Algorithms
>    Affects Versions: 4.1.3
>         Environment: all
>            Reporter: Anton Pevtsov
>            Priority: Minor
>             Fix For: 4.2.2
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> The following test fails to compile:
> #include <algorithm>
> #include <iterator>
> #include <iostream>
> struct no_assign {
>     int const x;
>     no_assign() : x(23) { }
>     operator int() const { return x; }
> };
>  // this program should output a single "23".
> int main()
> {
>     no_assign in[4];
>     std::unique_copy(in, in+4, std::ostream_iterator<int>(std::cout, "\n"));
> }
> The unique_copy standard requirements are still discussed:
> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#241
> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#538

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.