Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2003-05-04 12:28:44


At Sunday 5/4/2003 04:37 AM, you wrote:
>"Victor A. Wagner, Jr." wrote:
> >
> > At Saturday 5/3/2003 10:29 PM, you wrote:
> > >Rene Rivera wrote:
> > > > But I know of at least one need for "out" parameters:
> > > >
> > > > An asynchronous call that needs to "return" results. But
> because it's
> > > > asynch it can't return it as the result of the call.
> > >
> > >Good point. OTOH, can't this be considered an in/out parameter since
> > >the caller must own the object being set?
> >
> > No. The compiler must be able to tell whether a use before initialized
> > condition exists which is one way in which out and in_out are different.
>
>I think I'm missing something here. For example:
>
> T t;
> f( out( t ) );
>
>How is the compiler enforcing that 'f' is not using any state of t and
>is just setting it?

I'm not suggesting that, I'm suggesting

int t;
f(in_out(t));

is a use before initialization and the compiler should complain

and that

int t;
f(out(t));

should NOT complain.

>Thanks,
>Noel
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law"


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