mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-16 18:56:52 +02:00
latest changes from main repository; added eclipse cdt project files
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user