|
Boost : |
From: Floris van den Berg (flvdberg_at_[hidden])
Date: 2003-05-04 10:36:23
----- Original Message -----
From: "Noel Yap" <Noel.Yap_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Sunday, May 04, 2003 4:47 PM
Subject: Re: [boost] Re: in/out parameters, codingstylesandmaintenance
> Gregory Colvin wrote:
> >
> > I don't see the point of providing this
> >
> > void SetArea(c_out<CShape> s)
> > {
> > CShape &ls = s.get_ref();
> > ls.SetArea(100);
> > }
> >
> > and then writing this
> >
> > SetArea(out(psq));
> >
> > instead of just writing this in the first place
> >
> > psq->SetArea(100);
>
> I think a larger point that should be emphasized is that noone so far
> has been able to come up with a function that takes an out parameter
> that cannot be rewritten to return a value. IMHO, it makes sense to do
> so stylistically.
>
> I can understand some rationale for c_in and c_in_out, but not for
> c_out.
I think that c_out is practically the same as c_in_out, only with c_out the
called function doesn't care about the initial value of the passed
parameter.
Floris
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk