Boost logo

Boost :

From: Gregory Colvin (gregory.colvin_at_[hidden])
Date: 2003-04-23 13:17:12


On Wednesday, Apr 23, 2003, at 12:04 America/Denver, Terje Slettebø
wrote:

>> From: "Justin M. Lewis" <boost_at_[hidden]>
>
>> Well, I guess, based on all the code I've been reading at work it
>> didn't
>> seem so small, chasing down all kinds of functions across 100's of
>> files
>> to see why exactly values are changing mid function I'm looking at
>> without warning.
>>
>> Anyway, this would allow for stronger enforcement of the rule that
>> changing params should be marked somehow. As the programmer of a
>> library people are using, I can force them to mark the params they're
>> passing as out or in_out, so in 5 years when someone else comes along
>> and has to debug it, it's all clear what's happening.
>
> Why not use T & if the function may change it, and const T & if it
> won't?

Because looking at the call f(&x) I wonder what happens to x, whereas
looking at the call f(x) I don't?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk