Boost logo

Boost :

From: Justin M. Lewis (boost_at_[hidden])
Date: 2003-04-23 12:39:31


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.

Justin

-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of Vincent Finn
Sent: Wednesday, April 23, 2003 10:12 AM
To: boost_at_[hidden]
Subject: [boost] Re: class proposal

Justin M. Lewis wrote:
> Not entirely, passing a pointer doesn't tell you that the parameter
will
> change, it just tells you that it might, it still leaves you in the
position
> of having to track down the function and check it. But outside of
that, if
> you're like me, at this point you prefer references to pointers,
whenever
> possible.

I did use references everywhere but changed to pointers for the reason
you are talking about

I only use pointers if the argument might be changed
that way the &varName means varName will be changed in the function
if the arg won't be changed I pass const&

The only reason for doing this is to make it obvious which are in
parameters and which are out\inout
using a class just seemed like over kill for something so small

Oh well, it is all a matter of taste I suppose

        Vin

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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