2001-05-24 18:43:24 +00:00
|
|
|
// Boost shared_ptr_example2 implementation file -----------------------------//
|
|
|
|
|
2003-09-12 17:09:29 +00:00
|
|
|
// Copyright Beman Dawes 2001.
|
|
|
|
// See accompanying license for terms and conditions of use.
|
2003-02-04 13:35:06 +00:00
|
|
|
|
2003-09-12 17:09:29 +00:00
|
|
|
// See http://www.boost.org/libs/smart_ptr for documentation.
|
2003-02-04 13:35:06 +00:00
|
|
|
|
2001-05-24 18:43:24 +00:00
|
|
|
#include "shared_ptr_example2.hpp"
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
class example::implementation
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~implementation() { std::cout << "destroying implementation\n"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
example::example() : _imp( new implementation ) {}
|
|
|
|
|
|
|
|
void example::do_something()
|
|
|
|
{ std::cout << "use_count() is " << _imp.use_count() << "\n"; }
|