How do I set shared ptr to NULL

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 25
Reputation: Niner710 is an unknown quantity at this point 
Solved Threads: 0
Niner710 Niner710 is offline Offline
Light Poster

How do I set shared ptr to NULL

 
0
  #1
21 Days Ago
Hi,

I have a simple question on trying to set shared ptr to NULL.

I get an error(binary '=': no operator found which takes a right hand operand of type 'int') when I do this...

  1. typedef std::tr1::shared_ptr<A> A_smrt;
  2. A_smrt = NULL;

Why is this wrong?
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 113
Reputation: abhi_elementx is an unknown quantity at this point 
Solved Threads: 6
abhi_elementx's Avatar
abhi_elementx abhi_elementx is offline Offline
Junior Poster
 
0
  #2
21 Days Ago
Actually there is no need to initialise it to NULL as we do in case of normal pointers.
How ever, for more info, you can refer to the boost library docs.

Cheers
PEACE !
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC