mirror of
https://github.com/boostorg/smart_ptr.git
synced 2026-02-01 08:52:08 +00:00
This commit was manufactured by cvs2svn to create tag
'Version_1_22_0'. [SVN r10239]
This commit is contained in:
21
shared_ptr_example2.cpp
Normal file
21
shared_ptr_example2.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
// Boost shared_ptr_example2 implementation file -----------------------------//
|
||||
|
||||
#include "shared_ptr_example2.hpp"
|
||||
#include <iostream>
|
||||
|
||||
class example::implementation
|
||||
{
|
||||
public:
|
||||
~implementation() { std::cout << "destroying implementation\n"; }
|
||||
};
|
||||
|
||||
example::example() : _imp( new implementation ) {}
|
||||
example::example( const example & s ) : _imp( s._imp ) {}
|
||||
|
||||
example & example::operator=( const example & s )
|
||||
{ _imp = s._imp; return *this; }
|
||||
|
||||
void example::do_something()
|
||||
{ std::cout << "use_count() is " << _imp.use_count() << "\n"; }
|
||||
|
||||
example::~example() {}
|
||||
Reference in New Issue
Block a user