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

Add conversion to/from std::unique_ptr to QScopedPointer

XMLWordPrintable

      For increased SC while porting from QScopedPointer to std::unqiue_ptr, the two types should be convertible into each other (of course, only rvalues of each should be convertible).

      Acceptance Criteria:

      • QScopedPointer<T> has a constructor from std::unique_ptr<X> && for all X for which it also has a constructor from QScopedPointer<X> &&.
      • QScopedPointer<T> has a conversion operator to std::unique_ptr<X> for all X for which it also has conversion to QScopedPointer<X>, with the same explicit/implicit-ness.
      • IOW: For all T and X and UP = cvref unique_ptr and {{QSP = cvref QScopedPointer>
        1. static_assert(std::is_convertible_v<QSP<T>, QSP<X>> == std::is_convertible_v<QSP<T>, UP<X>)
        2. static_assert(std::is_convertible_v<QSP<T>, QSP<X>> == std::is_convertible_v<UP<T>, QSP<X>)
        3. ditto both for std::is_constructible_v
      • documented and tested

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

            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes