Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2020-06-22 13:30:46 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2020-06-22 13:30:46 +0300
commit35033e4699d3356db509e49cb84962679e5c74f5 (patch)
treea0fabbbbbc48cf4be19493a9a4eebd3f178f7ee4 /include/llfio/v2.0/symlink_handle.hpp
parentf6d801ff046e3efe7fcb322accaa0cd5ecf3dcf8 (diff)
Check for self-move in every move assignment operator.
Diffstat (limited to 'include/llfio/v2.0/symlink_handle.hpp')
-rw-r--r--include/llfio/v2.0/symlink_handle.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llfio/v2.0/symlink_handle.hpp b/include/llfio/v2.0/symlink_handle.hpp
index 8f7e7bb8..39706343 100644
--- a/include/llfio/v2.0/symlink_handle.hpp
+++ b/include/llfio/v2.0/symlink_handle.hpp
@@ -158,6 +158,10 @@ public:
//! Move assignment
buffers_type &operator=(buffers_type &&o) noexcept
{
+ if(this == &o)
+ {
+ return *this;
+ }
this->~buffers_type();
new(this) buffers_type(std::move(o));
return *this;
@@ -221,6 +225,10 @@ public:
//! Move assignment
const_buffers_type &operator=(const_buffers_type &&o) noexcept
{
+ if(this == &o)
+ {
+ return *this;
+ }
this->~const_buffers_type();
new(this) const_buffers_type(std::move(o));
return *this;
@@ -320,6 +328,10 @@ public:
//! Move assignment permitted
symlink_handle &operator=(symlink_handle &&o) noexcept
{
+ if(this == &o)
+ {
+ return *this;
+ }
this->~symlink_handle();
new(this) symlink_handle(std::move(o));
return *this;