$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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