Re: [Development] Recommended way to take in strings

2023-05-31 Thread Thiago Macieira
On Wednesday, 31 May 2023 22:38:11 PDT Marc Mutz via Development wrote: > On 31.05.23 16:05, Thiago Macieira wrote: > > [...] Therefore, if > > your function isn't named after a verb in the imperative, then it should > > be > > const QString &. > > Function names have nothing to do with it: `fromS

Re: [Development] Recommended way to take in strings

2023-05-31 Thread Marc Mutz via Development
On 31.05.23 16:05, Thiago Macieira wrote: > [...] Therefore, if > your function isn't named after a verb in the imperative, then it should be > const QString &. Function names have nothing to do with it: `fromString(~~stringish~~)` is a dead-sure candidate for QAnyStringView while `operator[](~~

Re: [Development] Recommended way to take in strings

2023-05-31 Thread A . Pönitz
On Wed, May 31, 2023 at 07:17:21AM +, Marc Mutz via Development wrote: > On 31.05.23 09:07, Sami Varanka via Development wrote: > > What is the recommended way for functions to take strings? Our QtGraphs > > API takes in const QString & but is recommended way nowadays take in > > QAnyStringVi

Re: [Development] Recommended way to take in strings

2023-05-31 Thread Thiago Macieira
On Wednesday, 31 May 2023 00:17:21 PDT Marc Mutz via Development wrote: > I doubt there's an accepted project-wide standard, yet, but as a rule of > thumb that everyone might be able to agree on: If the function doesn't > store the string as-is (=parses or pre-processes it), take by > QAnyStringVie

Re: [Development] Recommended way to take in strings

2023-05-31 Thread Marc Mutz via Development
On 31.05.23 09:07, Sami Varanka via Development wrote: > What is the recommended way for functions to take strings? Our QtGraphs > API takes in const QString & but is recommended way nowadays take in > QAnyStringView? I doubt there's an accepted project-wide standard, yet, but as a rule of thum

[Development] Recommended way to take in strings

2023-05-31 Thread Sami Varanka via Development
Hello What is the recommended way for functions to take strings? Our QtGraphs API takes in const QString & but is recommended way nowadays take in QAnyStringView? -- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development