Re: [Development] QTextStream::readLine(0) is an ambiguous overload in 5.5

2015-05-17 Thread Smith Martin
I think output parameters are supposed to be placed at the end; their names should indicate that they are outputs, and the documentation should say they are changed by the function. martin From: Giuseppe D'Angelo Sent: Sunday, May 17, 2015 9:57 PM To: S

Re: [Development] QTextStream::readLine(0) is an ambiguous overload in 5.5

2015-05-17 Thread Giuseppe D'Angelo
On Sun, May 17, 2015 at 9:55 PM, Smith Martin wrote: > How do you get bitten by an out-reference? As usual, because at call site I didn't realize the argument was actually being modified. Compare doSomething(param1, param2, param3); doSomething(¶m1, param2, param3); which one is likely to be mo

Re: [Development] QTextStream::readLine(0) is an ambiguous overload in 5.5

2015-05-17 Thread Smith Martin
How do you get bitten by an out-reference? From: development-bounces+martin.smith=theqtcompany@qt-project.org on behalf of Giuseppe D'Angelo Sent: Sunday, May 17, 2015 9:43 PM To: Marc Mutz Cc: development@qt-project.org Subject: Re: [Development] Q

Re: [Development] QTextStream::readLine(0) is an ambiguous overload in 5.5

2015-05-17 Thread Giuseppe D'Angelo
On Sun, May 17, 2015 at 10:17 PM, Marc Mutz wrote: > > *Any* form of out parameter is bad code policy. Much better in virtually all > cases to return multiple values in a small struct. No, I was simply referring to the specific case of using pointers instead of references. I've been bitten too ma

Re: [Development] QTextStream::readLine(0) is an ambiguous overload in 5.5

2015-05-17 Thread Thiago Macieira
On Sunday 17 May 2015 22:17:04 Marc Mutz wrote: > On Sunday 17 May 2015 15:19:49 Giuseppe D'Angelo wrote: > > It would solve, but Qt APIs use pointers instead of references for > > out-arguments (and that's a very good code policy). > > *Any* form of out parameter is bad code policy. Much better i

Re: [Development] QTextStream::readLine(0) is an ambiguous overload in 5.5

2015-05-17 Thread Marc Mutz
On Sunday 17 May 2015 15:19:49 Giuseppe D'Angelo wrote: > It would solve, but Qt APIs use pointers instead of references for > out-arguments (and that's a very good code policy). *Any* form of out parameter is bad code policy. Much better in virtually all cases to return multiple values in a smal

Re: [Development] QTextStream::readLine(0) is an ambiguous overload in 5.5

2015-05-17 Thread Giuseppe D'Angelo
On Sun, May 17, 2015 at 2:30 PM, Andre Somers wrote: > In the spirit of option b), would it be an option to have the method > take a QString& instead of a QString*? That would resolve the ambiguity. It would solve, but Qt APIs use pointers instead of references for out-arguments (and that's a ver

Re: [Development] QTextStream::readLine(0) is an ambiguous overload in 5.5

2015-05-17 Thread Andre Somers
On 13-5-2015 2:44, Thiago Macieira wrote: > On Wednesday 13 May 2015 02:34:28 Jan Kundrát wrote: >> Hi, >> this commit [1] added a new overload to QTextStream::readLine. As a result >> of that, calling stream.readLine(0) is now ambiguous: >> >> QString readLine(qint64 maxlen = 0); >> bool