Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
Foundation PM Staging
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>
- static_assert(std::is_convertible_v<QSP<T>, QSP<X>> == std::is_convertible_v<QSP<T>, UP<X>)
- static_assert(std::is_convertible_v<QSP<T>, QSP<X>> == std::is_convertible_v<UP<T>, QSP<X>)
- ditto both for std::is_constructible_v
- documented and tested