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
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
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
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
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
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
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
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