[Interest] QScopedPointer and c++11 move semantics

Alexander Dyagilev alervdvcw at gmail.com
Fri Dec 30 20:27:52 CET 2016


Hmmm.... So there is not std::unique_ptr analogue in Qt?

And we have to use std::unique_ptr with a special deleter...

(I would like to use &QObjet::deleteLater one).

Sadly...

Why don't you just introduce another class with another name that do 
support?

E.g. QUniquePointer : public QScopedPointer {...}. Or write a completely 
new one if you don't like this style...


On 12/30/2016 10:18 PM, Giuseppe D'Angelo wrote:
> Il 30/12/2016 19:47, Alexander Dyagilev ha scritto:
>> Hello,
>>
>> https://bugreports.qt.io/browse/QTBUG-29754
>>
>> states that the problem was fixed and QScopedPointer supports it now.
>>
> I implemented it in 5b9006bbdba7dcab01b8e640554a7d7a4b64f76b, but then a
> discussion on the mailing list caused the change to be reverted in
> 3f6ed5566fcfbbba4cadfade460460f8ebf06ad3. The rationale was that the
> name "QScopedPointer" implies that the pointer cannot escape the scope,
> and move operations whould allow that.
>
> HTH,
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161230/d585f2e4/attachment.html>


More information about the Interest mailing list