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

Add conversion to/from std::unique_ptr to QScopedPointer

    XMLWordPrintable

Details

    Description

      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

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes