mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-17 19:25:53 +02:00
latest changes from main repository; added eclipse cdt project files
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// AutoPtr.h
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/include/Poco/AutoPtr.h#6 $
|
||||
// $Id: //poco/Main/Foundation/include/Poco/AutoPtr.h#7 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Core
|
||||
@@ -190,6 +190,18 @@ public:
|
||||
return AutoPtr<Other>(pOther, true);
|
||||
}
|
||||
|
||||
template <class Other>
|
||||
AutoPtr<Other> unsafeCast() const
|
||||
/// Casts the AutoPtr via a static cast to the given type.
|
||||
/// Example: (assume class Sub: public Super)
|
||||
/// AutoPtr<Super> super(new Sub());
|
||||
/// AutoPtr<Sub> sub = super.unsafeCast<Sub>();
|
||||
/// poco_assert (sub.get());
|
||||
{
|
||||
Other* pOther = static_cast<Other*>(_ptr);
|
||||
return AutoPtr<Other>(pOther, true);
|
||||
}
|
||||
|
||||
C* operator -> ()
|
||||
{
|
||||
if (_ptr)
|
||||
|
Reference in New Issue
Block a user