mirror of
https://github.com/boostorg/smart_ptr.git
synced 2026-04-28 18:13:34 +02:00
Added a default constructor to shared_count and shared_ptr for incomplete types (void).
[SVN r12815]
This commit is contained in:
@@ -81,7 +81,11 @@ public:
|
||||
|
||||
typedef T element_type;
|
||||
|
||||
explicit shared_ptr(T * p = 0): px(p), pn(p, deleter())
|
||||
shared_ptr(): px(0), pn()
|
||||
{
|
||||
}
|
||||
|
||||
explicit shared_ptr(T * p): px(p), pn(p, deleter()) // requires complete type
|
||||
{
|
||||
}
|
||||
|
||||
@@ -157,9 +161,14 @@ public:
|
||||
|
||||
#endif
|
||||
|
||||
void reset(T * p = 0)
|
||||
void reset()
|
||||
{
|
||||
BOOST_ASSERT(p == 0 || p != px);
|
||||
this_type().swap(*this);
|
||||
}
|
||||
|
||||
void reset(T * p) // requires complete type
|
||||
{
|
||||
BOOST_ASSERT(p == 0 || p != px); // catch self-reset errors
|
||||
this_type(p).swap(*this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user