Boost logo

Boost :

From: Justin M. Lewis (boost_at_[hidden])
Date: 2003-05-04 17:27:07


Again, there's no way to write the functions in the example with return
values, so out params are necessary. And, while I'll admit, again, that the
example isn't great, the point is clear.

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

> "Justin M. Lewis" 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);
> > >
> >
> > You're not addressing the purpose of the idea here, just the specifics
of an
> > example I through together real fast. You can see the point, and the
> > proposed useage, how about responding to that, rather than nitpicking?
>
> I think the real point is that functions taking out parameters can be
> written to return values and doing so is a better style in C++.
>
> Have you considered that if you didn't have out parameters, your hunting
> would be that much easier?
>
> 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