[Development] HEADS-UP: QStringLiteral

Thiago Macieira thiago.macieira at intel.com
Wed Aug 21 17:58:31 CEST 2019


On Wednesday, 21 August 2019 08:16:42 PDT Tor Arne Vestbø wrote:
> That’s what I was hoping. We have QFooLiteral today to let the compiler do
> the work up front, isn’t it possible with newer c++ standards to have that
> happen automatically without an explicit QFooLiteral?

Yes, it's possible.

But do we want to? Remember that QStringLiteral today has a drawback: if you 
unload the plugin it came from, any left-over uses of it may crash. That's one 
of the many reasons we don't unload plugins, but other people might.

Requiring heap storage avoids that problem. And if we know that it's always 
heap storage, we can also simplify our memory management code by not having 
immutable d-pointers either.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Development mailing list