Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Q_MOVABLE_TYPE and QSharedDataPointer
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Q_MOVABLE_TYPE and QSharedDataPointer

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    Can a class containing a QSharedDataPointer be safely declared moveable, provided the object pointed to does not have a back pointer?

    That is, is there a guarantee that the QSharedDataPointer / QSharedData pair does not hide a back pointer somewhere in its implementation?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      Since no-one could answer this rather basic and sometimes crucial question, I forwarded it to Qt support.

      I'll post their answer here, as soon as I get it.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        Answer from support:

        bq. Provided that your type is movable then yes it is safe to declare a class as a movable type. The QSharedDataPointer<T> is already movable so you can indicate that the class itself is too. I think it is safe to assume that this behavior will be working in future versions, behavior changes can happen but something on this level would most likely only change between major releases.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          Thanks for sharing!

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved