Boost logo

Boost :

From: Justin M. Lewis (boost_at_[hidden])
Date: 2003-05-04 05:47:57


----- Original Message -----
From: "Terje Slettebø" <tslettebo_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Saturday, May 03, 2003 9:51 PM
Subject: Re: [boost] Re: in/out parameters, codingstylesandmaintenance

> >From: "Justin M. Lewis" <boost_at_[hidden]>
>
> > Yes, now imagine we live in a world where there are non-copyable objects
> > that you sometimes pass to functions, and tell me how you handle that
case
> > with return values.
>
> There may be ways to design an API to avoid this.
>
> For example:
>
> noncopyable object;
>
> object.f(); // No copy needed, to operate on the object.
>

That's all wonderful, assuming that object internally supports everything
you want to do to it, which probably isn't the case. And, it's hardly
reasonable to put members that handle all uses of the object inside the
object. Ok, so, object.f(), that modifies one thing you're interested in,
now say I want to modify other members, all at once, say I want to do the
same thing, from several different places inside my code. Now I need a
function that needs an out param or an in_out param.

> >Or, how about polymorphic types, where you can't simply create the object
> >internally in the function, where you HAVE to deal with what's passed in
in
> >one way or another.
>
> object_ptr->f();
>
>
> Regards,
>
> Terje
>
> _______________________________________________
> 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