Commit 1ed5cafc authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

exchange in DelayedDestruction move-ctor

Summary: [Folly] `exchange` in `DelayedDestruction` move-ctor.

Reviewed By: knekritz

Differential Revision: D10320776

fbshipit-source-id: b6b1f910b927098e61f6f6c8e414fdfcca843033
parent 1755d86d
......@@ -70,9 +70,8 @@ class DelayedDestructionBase : private boost::noncopyable {
DestructorGuard(const DestructorGuard& dg) : DestructorGuard(dg.dd_) {}
DestructorGuard(DestructorGuard&& dg) noexcept : dd_(dg.dd_) {
dg.dd_ = nullptr;
}
DestructorGuard(DestructorGuard&& dg) noexcept
: dd_(std::exchange(dg.dd_, nullptr)) {}
DestructorGuard& operator=(DestructorGuard dg) noexcept {
std::swap(dd_, dg.dd_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment