944,195 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 471
  • C++ RSS
Nov 3rd, 2009
0

How do I set shared ptr to NULL

Expand Post »
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...

C++ Syntax (Toggle Plain Text)
  1. typedef std::tr1::shared_ptr<A> A_smrt;
  2. A_smrt = NULL;

Why is this wrong?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Niner710 is offline Offline
31 posts
since Jul 2008
Nov 4th, 2009
0
Re: How do I set shared ptr to NULL
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
Reputation Points: 11
Solved Threads: 7
Junior Poster
abhi_elementx is offline Offline
118 posts
since Dec 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Calculation problems..
Next Thread in C++ Forum Timeline: C++ Simple Math Problems





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC