Files
UnrealEngine/Engine/Source/ThirdParty/FakeIt/2.0.2/include/mockutils/Finally.hpp
2025-05-18 13:04:45 +08:00

33 lines
559 B
C++

/*
* Finally.hpp
* Copyright (c) 2014 Eran Pe'er.
*
* This program is made available under the terms of the MIT License.
*
* Created on Aug 30, 2014
*/
#pragma once
#include <functional>
namespace fakeit {
class Finally {
private:
std::function<void()> _finallyClause;
Finally(const Finally &);
Finally &operator=(const Finally &);
public:
explicit Finally(std::function<void()> f) :
_finallyClause(f) {
}
~Finally() {
_finallyClause();
}
};
}