Boost logo

Boost :

From: Justin M. Lewis (boost_at_[hidden])
Date: 2003-05-03 19:04:06


----- Original Message -----
From: "Noel Yap" <Noel.Yap_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Saturday, May 03, 2003 4:57 PM
Subject: Re: [boost] Re: in/out parameters, codingstylesandmaintenance

> "Justin M. Lewis" wrote:
> > I consider references not to be pointers. I thought that was the point
of
> > references, something that has the benefits of a pointer, without as
much
> > danger as a pointer, that doesn't promote pointer useage.
>
> OK, can't you get safe pointer usage from smart pointers as well?
>
> > > I didn't get a response from this comment.
> > >
> > > > > Also, what stops people from:
> > > > >
> > > > > T t = out( t_ );
> > > > > f( t ); // this is an out parameter
> > > > >
> > > > > T t = in_out( t_ );
> > > > > f( t ); // this is an in/out parameter
> > >
> > > Neither from this.
> > >
> >
> > Well, out(t) doesn't return a T, it returns a c_out<T>, so it'd be
pretty
> > obvious
> >
> > c_out<T> whatever = out(t);
> > same with in_out.
>
> OK. Why not:
>
> c_out< T > t;
> f( t ); // this is an out parameter
>
> c_in_out< T > t;
> f( t ); // this is an in/out parameter
>

Ok, so what's wrong with that? You still know it's an out param, or an
in_out param, and can only be passed to functions that take the respective
type. I think I removed the cast operators? I forget, I did locally, to
fix that problem specifically.

> Noel
> _______________________________________________
> 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