Giuseppe D'Angelo schreef op 17-5-2015 om 21:57: > On Sun, May 17, 2015 at 9:55 PM, Smith Martin > <[email protected]> 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. _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
