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

"Generate getter" - better options to avoid undesired const ref return type

    XMLWordPrintable

Details

    • Windows
    • 4119181762 (qt-creator/qt-creator/master) 4119181762 (qt-creator/qt-creator/9.0)

    Description

      I have a large project with thousands of classes. Almost all classes which are passed via getters/setters are copyable by value (small or implicitly shared).

      Whenever I use "Generate getter and setter" and similar refactoring methods, I have to manually correct the returned const ref. On the other hand, managing the hundreds of custom value classes in Creator's settings just isn't feasible.

      Why not offer a setting to "return by value" by default?

      Or some intelligence that any copyable object will be returned by value, and only non-copyable objects will be returned by reference?

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            asperamanca Robert Schimkowitsch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes