forked from boostorg/smart_ptr
Moved smart_ptr contents to subdirectories, switched to a local test/Jamfile.
[SVN r17042]
This commit is contained in:
19
example/shared_ptr_example2.cpp
Normal file
19
example/shared_ptr_example2.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
// 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"; }
|
||||
Reference in New Issue
Block a user