latest changes from main repository; added eclipse cdt project files

This commit is contained in:
Guenter Obiltschnig
2007-04-29 14:25:52 +00:00
parent d740264009
commit a8990dca3f
11 changed files with 261 additions and 26 deletions

View File

@@ -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)