Skip to content

Commit 590f382

Browse files
author
SSS-XPS-9530
committed
Tidy up
1 parent 4ce432e commit 590f382

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/any_shared_ptr.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,6 @@ namespace xxx {
251251

252252
any_shared_ptr(any_shared_ptr const & other) noexcept { other.holder()->clone(&my_inplace_storage); }
253253

254-
any_shared_ptr(any_shared_ptr && other) noexcept
255-
{
256-
my_inplace_storage = other.my_inplace_storage;
257-
::new (&other.my_inplace_storage) any_shared_ptr();
258-
}
259-
260254
any_shared_ptr& operator=(any_shared_ptr const& other) noexcept
261255
{
262256
if (this != &other) {
@@ -267,12 +261,18 @@ namespace xxx {
267261
return *this;
268262
}
269263

264+
any_shared_ptr(any_shared_ptr && other) noexcept
265+
{
266+
my_inplace_storage = other.my_inplace_storage;
267+
::new (&other.my_inplace_storage) EmptyHolder();
268+
}
269+
270270
any_shared_ptr& operator=(any_shared_ptr && other) noexcept
271271
{
272272
if (this != &other) {
273273
this->~any_shared_ptr();
274274
my_inplace_storage = other.my_inplace_storage;
275-
::new (&other.my_inplace_storage) any_shared_ptr();
275+
::new (&other.my_inplace_storage) EmptyHolder();
276276
}
277277
// else a self-move - do nothing
278278
return *this;
@@ -296,7 +296,7 @@ namespace xxx {
296296
void reset() noexcept
297297
{
298298
this->~any_shared_ptr();
299-
::new (this) any_shared_ptr();
299+
::new (this) EmptyHolder();
300300
}
301301

302302
//-----------------------------------------------------

0 commit comments

Comments
 (0)