Bug 1725572 - Part 1: Support move-only closures in ScopeExit, r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D125895
This commit is contained in:
Nika Layzell
2021-09-23 18:54:31 +00:00
parent 5026a87273
commit d3d501d0b2

View File

@@ -93,7 +93,7 @@ class MOZ_STACK_CLASS ScopeExit {
public: public:
explicit ScopeExit(ExitFunction&& cleanup) explicit ScopeExit(ExitFunction&& cleanup)
: mExitFunction(cleanup), mExecuteOnDestruction(true) {} : mExitFunction(std::move(cleanup)), mExecuteOnDestruction(true) {}
ScopeExit(ScopeExit&& rhs) ScopeExit(ScopeExit&& rhs)
: mExitFunction(std::move(rhs.mExitFunction)), : mExitFunction(std::move(rhs.mExitFunction)),