[Development] HEADS-UP: QStringLiteral

Thiago Macieira thiago.macieira at intel.com
Thu Aug 22 23:08:47 CEST 2019

On Thursday, 22 August 2019 14:01:50 PDT Matthew Woehlke wrote:
> On 22/08/2019 15.09, Danila Malyutin wrote:
> > Can't it be alleviated/improved by providing user-defined literal for
> > QString(Literal)? So that one would only write   a["b"_qs] = "c"_qs.
> No; there is no (portable) way in C++17 (and I think still in C++20) for
> a UDL's return type to depend on the size (string length) of its input,
> which is required to implement QString literals. (I've tried...)

In Qt 5, the size is not sufficient, we need the actual content of the string. 
For Qt 6, that won't be needed, but we won't need an UDL either.

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

More information about the Development mailing list