|
Boost Users : |
From: TEA Hartmann, Steven (SHartmann_at_[hidden])
Date: 2002-12-12 11:42:23
Thanks all. That works beautifully.
-----Original Message-----
From: Tom Matelich [mailto:tmatelich_at_[hidden]]
Sent: Thursday, December 12, 2002 12:25 AM
To: 'Boost-Users_at_[hidden]'
Subject: RE: [Boost-Users] testing if shared_ptr has been assigned
if(b) should do it. shared_ptr has an implicit conversion to bool (sort
of).
> -----Original Message-----
> From: TEA Hartmann, Steven [mailto:SHartmann_at_[hidden]]
> Sent: Wednesday, December 11, 2002 11:02 AM
> To: boost-users_at_[hidden]
> Subject: [Boost-Users] testing if shared_ptr has been assigned
>
>
> 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?
> }
>
>
> Best Regards,
>
> Steve
>
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> Get 128 Bit SSL Encryption!
> http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/EbFolB/TM
> --------------------------------------------------------------
> -------~->
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
-----------------------------------------------------------------------
DISCLAIMER: Information contained in this message and/or
attachment(s) may contain confidential information of Zetec, Inc.
If you have received this transmission in error, please notify
the sender by return email.
-----------------------------------------------------------------------
Info: <http://www.boost.org>
Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
[Non-text portions of this message have been removed]
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