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

Missing move SMFs disable move semantics for QDom classes

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.4.0 Beta1
    • XML: DOM
    • None
    • 8
    • Foundation Sprint 122, Foundation Sprint 123, Foundation Sprint 124, Foundation Sprint 125, Foundation Sprint 126, Foundation Sprint 127, Foundation Sprint 128, Foundation Sprint 129, Foundation Sprint 130, Foundation Sprint 131, Foundation Sprint 132, Foundation Sprint 133, Foundation Sprint 134, Foundation Sprint 135, Foundation Sprint 136, Foundation Sprint 137, Foundation Sprint 138

      The QDom classes have user-defined copy Special Member Functions (SMFs) and a user-defined destructor, which disables the 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).

      Acceptance criteria:

      • All QDom value-like classes (incl. QDomNode hierarchy) have
        • an inline noexcept move constructor
        • an inline noexcept move-assignment operator
          • just swaps, not move-and-swap
        • an inline noexcept member-swap, if possible
          • probably need a way to prevent mixed-type swapping
            • see QPixmap/QBitmap for a technique
          • likely move-assignment needs the same protection
        • are marked as Q_DECLARE_SHARED, if possible
          • adding Q_D_S after release used to be BiC in Qt 5, check the situation in Qt 6, add Q_DECLARE_SHARED_NOT_RELOCATABLE_UNTIL_QT7 if Q_D_S is still a problem

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

            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

              Created:
              Updated:

                There are no open Gerrit changes