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

Complete addition of C++11 move semantics to Qt APIs

    XMLWordPrintable

Details

    • Epic
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • None
    • Core: Other, Other
    • None
    • move-semantics

    Description

      DL;DR: all copyable Qt classes should be (nothrow-)movable

      To this day (Qt 6.4), there are still Qt classes which have a user-defined copy Special Member Functions (SMFs), preventing implicit generation of move SMFs. These types are therefore not movable, in particular, they're not nothrow_move_

      {constructible,assignable}

      , so they perform more poorly than they could in many situations, such as returning from functions and reallocation of containers.

      Add move SMFs, possibly member-swap and free swap functions (by using Q_DECLARE_SHARED, if that's BC these days) to all copyable classes.

      Acceptance criteria: For each copyable class C:

      • either C
        • is nothrow move-constructible
        • is nothrow move-assignable
        • has a nothrow member-swap
        • has a nothrow ADL (free function) swap
          • Q_DECLARE_SHARED provides that
      • or
        • has a code comment explaining why it doesn't

      Attachments

        Issue Links

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

          Activity

            People

              cnn Qt Core & Network
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes