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

Make QRegExp's matching functions non-const

    XMLWordPrintable

Details

    Description

      Functions like:
      bool exactMatch(const QString &str) const;
      int indexIn(const QString &str, int offset = 0, CaretMode caretMode = CaretAtZero) const;
      int lastIndexIn(const QString &str, int offset = -1, CaretMode caretMode = CaretAtZero) const;

      Are const in QRegExp, leading one to erroneous code that accesses the same QRegExp object in different threads. If they were non-const, the user would be forced to create a copy per-thread.

      Another argument: those functions do modify the state of QRegExp because you can get the captured text information after trying to match.

      Attachments

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

        Activity

          People

            w00t Robin Burchell
            tmacieir Thiago Macieira (closed Nokia identity) (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes