[Development] unified data model API in QtCore => thin wrapper proposal

Lars Knoll lars.knoll at qt.io
Sun Oct 7 10:53:04 CEST 2018



> On 6 Oct 2018, at 00:47, Thiago Macieira <thiago.macieira at intel.com> wrote:
> 
> On Friday, 5 October 2018 08:35:10 PDT Thiago Macieira wrote:
>> Cons:
>> Suppresses move construction as in
>>    QCborValue v = array[n];
>> this still compiles, but passes through the copy constructor, not the move
>> one. We cana add an extra move constructor for const QCborValue && if
>> necessary.
> 
> Never mind, you can't move from the const rvalue reference. It needs to be 
> modifiable.
> 
> So, again: should we have the const in the return types at the expense of 
> losing the move semantic?

I’d go for returning a const object. It’s a shame to loose the move semantics, but the other case would lead to easy programming errors.

Cheers,
Lars



More information about the Development mailing list