diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2020-06-22 13:30:46 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2020-06-22 13:30:46 +0300 |
commit | 35033e4699d3356db509e49cb84962679e5c74f5 (patch) | |
tree | a0fabbbbbc48cf4be19493a9a4eebd3f178f7ee4 /include/llfio/v2.0/path_handle.hpp | |
parent | f6d801ff046e3efe7fcb322accaa0cd5ecf3dcf8 (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.hpp | 4 |
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; |