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

std::vector<bool>::insert() broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 4.1.2, 4.1.3
    • 4.2.0
    • 23. Containers
    • None
    • all

    Description

      Moved from the Rogue Wave bug tracking database:

      #include <cassert>
      #include <vector>

      int main ()
      {
      const bool a[] =

      { false, false, true, true }

      ;

      std::vector<bool> v (a, a + 3);

      const std::vector<bool>::iterator it = v.end () - 1;

      v.insert (it, true);

      const std::vector<bool> res (a, a + 4);

      assert (v == res);
      }

      Compiling it with EDG eccp 3.4 on SunOS 5.7 against libstd 4.0 and running yields:

      $ ./t
      t.cpp:16: Assertion 'v == res' failed.
      Abort (core dumped)

      Attachments

        Activity

          People

            sebor Martin Sebor
            sebor Martin Sebor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: