[Development] HEADS-UP: QStringLiteral

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Wed Aug 21 18:21:32 CEST 2019

> On 21 Aug 2019, at 18:01, Thiago Macieira <thiago.macieira at intel.com> wrote:
> On Wednesday, 21 August 2019 08:49:52 PDT Tor Arne Vestbø wrote:
>> I agree that this would mitigate the problem somewhat, but imagine writing
>> your code and being reminded every second:
>>   warning: using “foo" is not optimal, you should be using
>> QEsotericLiteralStringViewV2NG
> is that worse than Creator showing in yellow that "warning: comparison of 
> integers of different signs: unsigned long and int" ?
> Or "macro name is a reserved identifier" in
> #define _GNU_SOURCE

Depends on your chosen warning level I guess. If you want -Wall -Wpedantic -Wextra ++ then sure, that’s what you’d expect. 

I would not want to have those “you’re using a fast, but not optimal version of the N string classes” warnings unless I was writing string heavy and performance sensitive code.

And if we can have the compiler automatically make the right choice for us we wouldn’t need any of those.

Tor Arne 

More information about the Development mailing list