AutoPtrHolderChecked inherits from AutoPtrHolder
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@490 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
d37172eddd
commit
00bb8d6ba8
1 changed files with 5 additions and 16 deletions
|
@ -127,21 +127,15 @@ namespace Loki
|
||||||
template<class> class Del,
|
template<class> class Del,
|
||||||
template<class> class ErrorPolicy = ExceptionOnPimplError
|
template<class> class ErrorPolicy = ExceptionOnPimplError
|
||||||
>
|
>
|
||||||
struct AutoPtrHolderChecked
|
struct AutoPtrHolderChecked : AutoPtrHolder<Impl,Ptr,Del>
|
||||||
{
|
{
|
||||||
static bool init_;
|
static bool init_;
|
||||||
|
|
||||||
AutoPtrHolderChecked() : ptr(Ptr())
|
AutoPtrHolderChecked()
|
||||||
{
|
{
|
||||||
init_ = true;
|
init_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
~AutoPtrHolderChecked()
|
|
||||||
{
|
|
||||||
// delete automatically by the delete policy
|
|
||||||
Del<Ptr>::Destroy( ptr );
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
operator T&()
|
operator T&()
|
||||||
{
|
{
|
||||||
|
@ -152,14 +146,6 @@ namespace Loki
|
||||||
Create();
|
Create();
|
||||||
return *ptr;
|
return *ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr Create()
|
|
||||||
{
|
|
||||||
ptr = Ptr( new Impl );
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ptr ptr;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template
|
template
|
||||||
|
@ -364,6 +350,9 @@ namespace Loki
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// $Log$
|
// $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
|
// Revision 1.7 2006/01/16 19:48:23 syntheticpp
|
||||||
// add error policy
|
// add error policy
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue