Boost logo

Boost :

From: Noel Yap (Noel.Yap_at_[hidden])
Date: 2003-05-04 12:43:23


"Victor A. Wagner, Jr." wrote:
> >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.

I'm still not getting it. Are you saying that:

  void f( out< T > p_ );
  f( in_out( p ) ); // compiler complains since function signature
doesn't match

or:

  void f( in_out< T > p_ );
  int p;
  f( in_out( p ) ); // compiler complains since p is not initialized

  void f( out< T > p_ );
  int p;
  f( out( p ) ); // compiler doesn't complain since p is just an out
parameter

Thanks,
Noel


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