From 00bb8d6ba8b502288feca445ede54aa8930eeec1 Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Tue, 17 Jan 2006 11:07:34 +0000 Subject: [PATCH] AutoPtrHolderChecked inherits from AutoPtrHolder git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@490 7ec92016-0320-0410-acc4-a06ded1c099a --- include/loki/Pimpl.h | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/include/loki/Pimpl.h b/include/loki/Pimpl.h index 407129c..62a58ab 100755 --- a/include/loki/Pimpl.h +++ b/include/loki/Pimpl.h @@ -127,21 +127,15 @@ namespace Loki template class Del, template class ErrorPolicy = ExceptionOnPimplError > - struct AutoPtrHolderChecked + struct AutoPtrHolderChecked : AutoPtrHolder { static bool init_; - AutoPtrHolderChecked() : ptr(Ptr()) + AutoPtrHolderChecked() { init_ = true; } - ~AutoPtrHolderChecked() - { - // delete automatically by the delete policy - Del::Destroy( ptr ); - } - template operator T&() { @@ -152,14 +146,6 @@ namespace Loki Create(); return *ptr; } - - Ptr Create() - { - ptr = Ptr( new Impl ); - return ptr; - } - - Ptr ptr; }; template @@ -364,6 +350,9 @@ namespace Loki #endif // $Log$ +// Revision 1.8 2006/01/17 11:07:34 syntheticpp +// AutoPtrHolderChecked inherits from AutoPtrHolder +// // Revision 1.7 2006/01/16 19:48:23 syntheticpp // add error policy //