Boost logo

Boost Users :

From: Darin Adler (darin_at_[hidden])
Date: 2002-12-11 18:29:36


On Wednesday, December 11, 2002, at 11:01 AM, TEA Hartmann, Steven
wrote:

> I need some help in testing for the condition of whether a shared_ptr
> has been assigned. In the following example, the "if( b != NULL )
> does not work. How would I do this test?
>
> typedef boost::shared_ptr<int> IPtr;
>
> int i( 0 );
> IPtr a( i );
> IPtr b;
>
> if( some condition )
> b = a;
>
> if( b != NULL ) { // How should this really be coded?
> }

if (b)

     -- Darin


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net