[Development] HEADS-UP: QStringLiteral

Thiago Macieira thiago.macieira at intel.com
Wed Aug 21 16:55:25 CEST 2019


On Wednesday, 21 August 2019 07:47:23 PDT Thiago Macieira wrote:
> On Wednesday, 21 August 2019 03:01:29 PDT Tor Arne Vestbø wrote:
> > This should just be test[“key”] = “value”. How do we get there?
> 
> Do you mean "make this the most optimal?" If so, then we don't get there.
> It's not possible.

Oh, the following is nearly the most optimal:

	test[u"key"] = u"value";

Depending on what tricks we do to QString, we can make it most optimal. In Qt 
5, we did it with QStringLiteral. For Qt 6, if we retain QStringLiteral, it 
would be a special QString that has immutable data.

We can experiment to see what C++17 std::is_constant_evaluated() allows us to 
guess.

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






More information about the Development mailing list