From: Justin M. Lewis (boost_at_[hidden])
Date: 2003-05-03 22:57:57
----- Original Message -----
From: "Noel Yap" <Noel.Yap_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Saturday, May 03, 2003 8:32 PM
Subject: Re: [boost] Re: in/out parameters, codingstylesandmaintenance
> "Justin M. Lewis" wrote:
> > > > Again, like I said, everything new has some associated learning
> > and a
> > > > lot of what goes into boost is NEW.
> > >
> > > The interface to the smart pointers is not new -- it exists in
> > > std::auto_ptr<>.
> > So what, the interface to smart_ptrs might not be, but you ignored all
> > the other examples. Your argument is basically that we should avoid new
> > things whenever possible, because people would have to learn how to use
> > them.
> No, my argument is to stick to old things when possible. In this case,
> it's possible.
Again, you can do everything in C that we do in C++, there is a way to do
it, so by your argument we shouldn't have ever moved to C++. But, the point
here is, we know there are some nice features in C++ that make programming
easier and cleaner, despite the fact that we CAN accomplish the same things
in C. So, sometimes moving on to something new is justified. And in the
case of c_out and c_in_out, their interfaces aren't so complex that people
would have trouble figuring out their use.
> > And as I pointed out there are very old C ways of doing everything we
> > do in C++, but we all learned C++ anyway, because there are advantages
> > the new C++ way of doing things.
> Not everything (eg templates).
You don't need templates, you can do a lot of what is done with templates
with either macros, or void *'s
> > And, I'm proposing a yet newer way of doing this that definetly has
> > advantages over the old way.
> If it has definite advantages, why have so many boost developers not
> bought into it?
Maybe they're leading sheltered lives? I don't know. But, while boost
developers may not be buying into it, the people from the C++ IRC channelw
here I originally discussed this idea do seem to like it. So do the people
I work with.
> > Again, how do you differentiate the use of a dumb_ptr that's just you
> > a pointer, because the function is expecting data that has been
> > with new, from an out, or in_out param?
> One more time:
> void f( dumb_ptr< T const > in_ );
> void f( dumb_ptr< T > inOut_ );
> dumb_ptr< T > f(); // out
> int i = 5;
> dumb_ptr< int const > in( &i );
> dumb_ptr< int > inOut( &i );
> dumb_ptr< int > out = f();
> f( in );
> f( inOut );
> Exactly what's confusing you with the above?
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk