[Development] QTextStream::readLine(0) is an ambiguous overload in 5.5
André Somers
andre at familiesomers.nl
Mon May 18 11:00:42 CEST 2015
Giuseppe D'Angelo schreef op 17-5-2015 om 21:57:
> On Sun, May 17, 2015 at 9:55 PM, Smith Martin
> <Martin.Smith at theqtcompany.com> 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 modifying arguments?
>
Right. So the policy is enforcing the use of a pointer argument to
sort-of* force the use of the address-of operator so the
potentially-modified argument is easier to spot in the code? If so,
perhaps it would be better to improve the editors and let them highlight
parameters to functions that may get changed by the function call.
André
*) you could already have a pointer, not needing the operator. And
pointers are also passed for other reasons. Reverse, the pointer
argument may also be const, thus promissing not to change the contents.
You cannot rely on that clue.
More information about the Development
mailing list