Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-171

[LWG #538] std::unique_copy() requires CopyConstructible and Assignable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • 4.1.3
    • None
    • 25. Algorithms
    • None
    • all

    • Usability

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            pevtsov Anton Pevtsov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified