Boost logo

Boost :

From: Noel Yap (Noel.Yap_at_[hidden])
Date: 2003-05-03 18:57:44


"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

Noel


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