mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-17 11:05:03 +02:00
#2172: Add Poco::AutoPtr::reset() and Poco::SharedPtr::reset()
This commit is contained in:
@@ -134,6 +134,36 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
if (_ptr)
|
||||
{
|
||||
_ptr->release();
|
||||
_ptr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void reset(C* ptr)
|
||||
{
|
||||
assign(ptr);
|
||||
}
|
||||
|
||||
void reset(C* ptr, bool shared)
|
||||
{
|
||||
assign(ptr, shared);
|
||||
}
|
||||
|
||||
void reset(const AutoPtr& ptr)
|
||||
{
|
||||
assign(ptr);
|
||||
}
|
||||
|
||||
template <class Other>
|
||||
void reset(const AutoPtr<Other>& ptr)
|
||||
{
|
||||
assign<Other>(ptr);
|
||||
}
|
||||
|
||||
AutoPtr& operator = (C* ptr)
|
||||
{
|
||||
return assign(ptr);
|
||||
|
Reference in New Issue
Block a user