Boost logo

Boost :

From: Gregory Colvin (gregory.colvin_at_[hidden])
Date: 2003-05-03 18:28:23


On Saturday, May 3, 2003, at 17:13 America/Denver, Noel Yap wrote:

> Noel Yap wrote:
>> std::auto_ptr< T > t( new T() );
>> f( boost::dumb_ptr< T >( t.get() ); // clearly an in/out parameter
>
> Or if you don't want to dynamically allocate t:
>
> T t;
> f( boost::dumb_ptr< T >( &t ) ); // clearly an in/out parameter
>
> static T t;
> f( boost::dumb_ptr< T >( &t ) ); // clearly an in/out parameter

Not so clear -- it depends on whether f() cares about the initial
value of t. Also, not in my opinion any more clear than:

    f(&t);


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