Smart pointer and utility changes related to adding checked_delere and checked_array_delete

[SVN r10189]
This commit is contained in:
Beman Dawes
2001-05-22 18:58:21 +00:00
parent ac8d0f5505
commit a90a157ea6
9 changed files with 167 additions and 41 deletions

21
scoped_ptr_example.hpp Normal file
View File

@@ -0,0 +1,21 @@
// Boost scoped_ptr_example header file ------------------------------------//
#include <boost/smart_ptr.hpp>
// The point of this example is to prove that even though
// example::implementation is an incomplete type in translation units using
// this header, scoped_ptr< implementation > is still valid because the type
// is complete where it counts - in the inplementation translation unit where
// destruction is actually instantiated.
class example : boost::noncopyable
{
public:
example();
~example();
void do_something();
private:
class implementation;
boost::scoped_ptr< implementation > _imp; // hide implementation details
};