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 @@
//
// SharedPtr.h
//
// $Id: //poco/Main/Foundation/include/Poco/SharedPtr.h#10 $
// $Id: //poco/Main/Foundation/include/Poco/SharedPtr.h#11 $
//
// Library: Foundation
// Package: Core
@@ -198,6 +198,18 @@ public:
return SharedPtr<Other>();
}
template <class Other>
SharedPtr<Other> unsafeCast() const
/// Casts the SharedPtr via a static cast to the given type.
/// Example: (assume class Sub: public Super)
/// SharedPtr<Super> super(new Sub());
/// SharedPtr<Sub> sub = super.unsafeCast<Sub>();
/// poco_assert (sub.get());
{
Other* pOther = static_cast<Other*>(_ptr);
return SharedPtr<Other>(_pCounter, pOther);
}
C* operator -> ()
{
return deref();