[Interest] Qt 5.1, does QVector not support std::unique_ptr?

Mark markg85 at gmail.com
Thu Jul 4 22:11:40 CEST 2013


On Thu, Jul 4, 2013 at 10:02 PM, Giuseppe D'Angelo <dangelog at gmail.com> wrote:
> On 4 July 2013 21:50, Mark <markg85 at gmail.com> wrote:
>>
>>
>> Defining a QVector with an std::unique_ptr seems to work just fine. No
>> error, compile wise.
>> QVector<std::unique_ptr<QUrl>> test;
>
> You can't use std::unique_ptr in Qt containers. Qt containers require
> the type to have a default constructor, a copy constructor, and an
> assignment operator [1], and you can't copy a std::unique_ptr.
>
> [1] http://qt-project.org/doc/qt-5.0/qtcore/containers.html#assignable-data-type
> --
> Giuseppe D'Angelo

Ahh, oke. That makes it obvious.

But is this something that is planned to be allowed for a future Qt
version? Please don't say "Qt 6" :p



More information about the Interest mailing list