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

std::string::assign (reverse_iterator, reverse_iterator) assigning self incorrect

Add voteWatch issue
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.1.2, 4.1.3, 4.1.4, 4.2.0
    • Fix Version/s: 4.3.0
    • Component/s: 21. Strings
    • Labels:
      None
    • Environment:

      All

    • Severity:
      Incorrect Behavior

      Description

      The 21.string.assign.cpp test has been failing a number of assertions for self-referential test cases that exercise the ability to assign a substring of a string into itself using the assign(InputIterator, InputIterator) member template specialization for InputIterator being an actual reverse_iterator. The program below reproduces the problem in a small isolated test case.

      #include <cassert>
      #include <string>

      int main ()
      {
      std::string s ("abc");
      s.assign (s.rbegin () + 1, s.rend ());
      assert ("ba" == s);
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                farid Farid Zaripov

                Dates

                • Created:
                  Updated:

                  Issue deployment