Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20768

pretty printers print wrong/misleading values of std::set<int>

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • Qt Creator 15.0.0-beta1
    • Qt Creator 4.7.0
    • Debugger
    • None
    • Kubuntu 18.04
    • Linux/X11

    Description

      In a code like below pretty printers print wrong/misleading values of std::set<int>:

      #include <set>
      
      int main()
      {
        std::set<int> s;
      
        s.insert(0);
        s.insert(1);
        s.insert(2);
        s.insert(3);
        s.insert(4);
        s.insert(5);
        s.insert(6);
        s.insert(7);
        s.insert(8);
        s.insert(9);
        return 0;
      } 

      during debugging session when the cursor is at return 0 the locals window shows:

      s <10 elements> std::set<int, std::less<int>, std::allocator<int> >
      [0] 0 int
      [1] 1 int
      [2] 2 int
      [3] 1 int
      [4] 2 int
      [5] 1 int
      [6] 2 int
      [7] 1 int
      [8] 2 int
      [9] 1 int

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            hjk hjk
            proton proton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes