[Development] qMoveToConst helper for rvalue references to movable Qt containers?

Thiago Macieira thiago.macieira at intel.com
Sat Oct 27 22:23:00 CEST 2018


On Saturday, 27 October 2018 08:33:30 PDT Sérgio Martins wrote:
> Should we instead just encourage people to make returnsQtContainer()
> return a const container ?

We should not, since the prevents move-construction from happening. You'll pay 
the cost of two reference counts (one up and one down).

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Development mailing list