Boost logo

Boost :

From: Noel Yap (Noel.Yap_at_[hidden])
Date: 2003-05-03 20:01:52


Gregory Colvin wrote:
> > So you're saying the parameter can be an out-only parameter? If so,
> > for
> > out parameters, use:
> >
> > boost::dumb_ptr< T > f();
> > t = f();
> >
> > IMHO, the intent is much more clear than:
> >
> > f( out< T > t );
> > f( out< T >( t ) );
>
> Not to me it isn't.

So we've established that we disagree about the coding style. Does this
mean that c_out, a subjective coding style helper, shouldn't be put in
the C++ standard, a, ummm, standard?

> Anyway, I dislike out parameters more than I do raw pointers.

So do I.

>From the above, it sounds like you would rather use out parameters than
return values. Do you write code like:

  void square_root( double input_, double& output_ );

rather than:

  double square_root( double input_ );

Noel


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