Boost logo

Boost :

From: Justin M. Lewis (boost_at_[hidden])
Date: 2003-05-04 15:25:40


----- Original Message -----
From: "Noel Yap" <Noel.Yap_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Sunday, May 04, 2003 7:47 AM
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.

Rewrite that to use a return value. You can't, inside the function you
do'nt know what the real type is.

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