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/path_handle.hpp
parentf6d801ff046e3efe7fcb322accaa0cd5ecf3dcf8 (diff)
Check for self-move in every move assignment operator.
Diffstat (limited to 'include/llfio/v2.0/path_handle.hpp')
-rw-r--r--include/llfio/v2.0/path_handle.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llfio/v2.0/path_handle.hpp b/include/llfio/v2.0/path_handle.hpp
index 816caec3..a931bd42 100644
--- a/include/llfio/v2.0/path_handle.hpp
+++ b/include/llfio/v2.0/path_handle.hpp
@@ -81,6 +81,10 @@ public:
//! Move assignment permitted
path_handle &operator=(path_handle &&o) noexcept
{
+ if(this == &o)
+ {
+ return *this;
+ }
this->~path_handle();
new(this) path_handle(std::move(o));
return *this;