mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
44b4c2db49
So far in all our uses of ScopeGuard, the type of the callable is usually just a lambda or a function pointer, so there is no need to rely on std::function's type erasure. While the cost of using std::function is probably negligible, it still causes some unnecessary overhead that can be avoided by making ScopeGuard a templated class. Thanks to class template argument deduction in C++17 most existing usages do not even need to be changed. See https://godbolt.org/z/KcoPni for a comparison between a ScopeGuard that uses std::function and one that doesn't