Click here to Skip to main content
15,884,892 members
Articles / Programming Languages / C++

C++11 Smart Pointers

Rate me:
Please Sign up or sign in to vote.
4.93/5 (79 votes)
26 Sep 2013CPOL12 min read 248.7K   4.3K   122  
Various Smart Pointers in C++11
#include <memory>
using namespace std;

class B;
class A
{
public:
	A( ) {};
			~A()
			{
				int j = 0;
			}
			//shared_ptr<B> m_spToB;
			B* m_spToB;
};

class B
{
public:
	B( ) {};
			~B()
			{
				int k = 0;
			}
			//shared_ptr<A> m_spToA;
			A* m_spToA;
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
I'm working as Senior software Engineer since 7 years and interested in MFC and COM programming.

Comments and Discussions