Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-105109

Example code related to QHash::erase() fails clazy

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 6.3.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      MacBook Pro (M1); Qt 6.2.2; QtCreator 7.0.0; Apple clang 13.0.0
    • Platform/s:
      macOS

      Description

      Example code related to QHash::erase() yields a clazy warning:

       

      Mixing iterators with const_iterators [clazy-strict-iterators]
      Documentation:
      https://github.com/KDE/clazy/blob/1.11/docs/checks/README-strict-iterators.md

       

      I have tested 2 examples:

       

      I haven't tested further examples related to QHash::erase() but it may be the case there too.

      It may also be the case with erase() for other containers.

      Is this an issue with the documentation or should there be a constructor of the following form?

      const_iterator::const_iterator(iterator &other)
      

        Attachments

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

          Activity

            People

            Assignee:
            cnn Qt Core & Network
            Reporter:
            paulmasri Paul
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes