[Interest] use of deleted function errors in QList / qarraydataops.h

Hamish Moffatt hamish at risingsoftware.com
Mon Feb 27 22:05:01 CET 2023


On 28/2/23 04:14, Thiago Macieira wrote:
> On Sunday, 26 February 2023 23:24:43 PST Hamish Moffatt via Interest wrote:
>> Is there a solution?
> Remove the const in:
>
>       struct S
>       {
>           const QVector<int> v; // compiles if not const
>       };
>
> If S is not copyable, then QVector can't copy it and QVector requires copying
> all its elements.

May I ask why that is? Qt5 QVector and std::vector are both OK with the 
above.


Hamish



More information about the Interest mailing list