1 // Boost scoped_ptr_example implementation file -----------------------------// 2 3 // Copyright Beman Dawes 2001. Distributed under the Boost 4 // Software License, Version 1.0. (See accompanying file 5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 7 8 // See http://www.boost.org/libs/smart_ptr for documentation. 9 10 #include "scoped_ptr_example.hpp" 11 #include <iostream> 12 13 class example::implementation 14 { 15 public: ~implementation()16 ~implementation() { std::cout << "destroying implementation\n"; } 17 }; 18 example()19example::example() : _imp( new implementation ) {} 20 do_something()21void example::do_something() { std::cout << "did something\n"; } 22 ~example()23example::~example() {} 24