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@aus.telusa.com] Sent: Wednesday, December 11, 2002 11:02 AM To: boost-users@yahoogroups.com 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@yahoogroups.com
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. -----------------------------------------------------------------------
participants (1)
-
Tom Matelich