Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-09 Thread Giuseppe D'Angelo via Development
Il 09/03/21 07:42, André Pönitz ha scritto: What if there weren't overloads of the actual functions on QString and QStringView? https://wandbox.org/permlink/rdIhbPRdGHuWWxFW I'm not sure what QStringArg is supposed to be: a view? A container? A type-erased view-or-container? Anyways, this i

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-08 Thread André Pönitz
> Ville Voutilainen > On Fri, 5 Mar 2021 at 14:26, Giuseppe D'Angelo via Development > wrote: > > > > Il 05/03/21 12:08, Tor Arne Vestbø ha scritto: > > > This seems like a bug though? From an API point of view, I’d expect this > > > simple assignment to JustWorkTM, without requiring syntactic s

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-05 Thread Thiago Macieira
On Friday, 5 March 2021 04:40:24 PST Lars Knoll wrote: > I wish we had a good way of adding that overloaded constructor to QString. > Unfortunately, we have lots of API that is overloaded on both QString and > QStringView. Adding the constructor to QString will then cause ambiguities > wherever we

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-05 Thread Giuseppe D'Angelo via Development
Il 05/03/21 13:51, Andrei Golubev ha scritto: That said, QByteArray's ctor accepting char* is not explicit (which kind of makes sense) and we have this ambiguity for f(QByteArray) and f(QByteArrayView) I believe. But guessing that it's not expected that QByteArrayView would be as popular as QSt

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-05 Thread Andrei Golubev
Voutilainen Sent: Friday, March 5, 2021 1:38 PM To: Giuseppe D'Angelo Cc: Qt development mailing list Subject: Re: [Development] User-defined literals for QString (and QByteArray) On Fri, 5 Mar 2021 at 14:26, Giuseppe D'Angelo via Development wrote: > > Il 05/03/21 12:08, Tor Arne

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-05 Thread Lars Knoll
On 5 Mar 2021, at 12:08, Tor Arne Vestbø mailto:tor.arne.ves...@qt.io>> wrote: On 3 Mar 2021, at 16:53, Andrei Golubev mailto:andrei.golu...@qt.io>> wrote: QString hello = u"Hello"; // oops, compilation error This seems like a bug though? From an API point of view, I’d expect this simple ass

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-05 Thread Ville Voutilainen
On Fri, 5 Mar 2021 at 14:26, Giuseppe D'Angelo via Development wrote: > > Il 05/03/21 12:08, Tor Arne Vestbø ha scritto: > > This seems like a bug though? From an API point of view, I’d expect this > > simple assignment to JustWorkTM, without requiring syntactic sugar all > > over the place. Shoul

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-05 Thread Giuseppe D'Angelo via Development
Il 05/03/21 12:08, Tor Arne Vestbø ha scritto: This seems like a bug though? From an API point of view, I’d expect this simple assignment to JustWorkTM, without requiring syntactic sugar all over the place. Shouldn’t we fix this, so we don’t need (or leave optional) an explicit _qs suffix? Be

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-05 Thread Edward Welbourne
On 3 Mar 2021, at 16:53, Andrei Golubev mailto:andrei.golu...@qt.io>> wrote: >> QString hello = u"Hello"; // oops, compilation error Tor Arne Vestbø (5 March 2021 12:08) replied: > This seems like a bug though? From an API point of view, I’d expect > this simple assignment to JustWorkTM, without

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-05 Thread Tor Arne Vestbø
On 3 Mar 2021, at 16:53, Andrei Golubev mailto:andrei.golu...@qt.io>> wrote: QString hello = u"Hello"; // oops, compilation error This seems like a bug though? From an API point of view, I’d expect this simple assignment to JustWorkTM, without requiring syntactic sugar all over the place. Sho

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-05 Thread Andrei Golubev
pment] User-defined literals for QString (and QByteArray) On Wednesday, 3 March 2021 07:53:25 PST Andrei Golubev wrote: > This is the proposal in a nutshell. I'd like to have some feedback and then > some suggestions regarding: > > * Whether we want this for QByteArray as well

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-03 Thread Thiago Macieira
On Wednesday, 3 March 2021 07:53:25 PST Andrei Golubev wrote: > This is the proposal in a nutshell. I'd like to have some feedback and then > some suggestions regarding: > > * Whether we want this for QByteArray as well (similarly to QString it > allows "from raw data" construction, but then i

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-03 Thread Thiago Macieira
On Wednesday, 3 March 2021 08:57:03 PST Giuseppe D'Angelo via Development wrote: > > There's of course QStringLiteral: > > QString hello = QStringLiteral("Hello"); // yay, it works > > ... and, actually, QStringLiteral in Qt 6 is great, because it doesn't > > allocate the memory* to store that lit

Re: [Development] User-defined literals for QString (and QByteArray)

2021-03-03 Thread Giuseppe D'Angelo via Development
Howdy, Il 03/03/21 16:53, Andrei Golubev ha scritto: Hello, I've been now working for a while with literals that have to (eventually) be converted to QString one way or another. While in certain cases (e.g. myMsg == u"This is my message" or u"Hello, " + world) character literals are handled

[Development] User-defined literals for QString (and QByteArray)

2021-03-03 Thread Andrei Golubev
Hello, I've been now working for a while with literals that have to (eventually) be converted to QString one way or another. While in certain cases (e.g. myMsg == u"This is my message" or u"Hello, " + world) character literals are handled neatly by some underlying machinery, pure assignments ju