> On 6 Oct 2018, at 00:47, Thiago Macieira <[email protected]> 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

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to