
On 2/9/06, Sebastian Redl <sebastian.redl@getdesigned.at> wrote:
Johan Johansson wrote: The reason is simple: call-by-reference and call-by-value have no visible difference at the call site, which could therefore make changes to the arguments unexpected.
supposing std::fstream myfile: int i; myfile >> i; myfile << i; char c; myfile.get(c); It's not "myfile >> &i;", nor is it "myfile.get(&c);", and yet you understand fine. If I know what a function does--which is hopefully fairly obvious from its name--then I know which are output parameters, and the & is just an annoyance. If I don't know what the function does, then I'll have to look it up in documentation to find out, at which point I'll learn what the parameters are for. The & might be slightly useful were I trying divination to figure out what the function does, but even without that most non-gargantuan functions make it fairly clear which are output parameters from context. ~ Scott