diff options
| author | Léo Lam <leo@leolam.fr> | 2020-02-15 21:13:29 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2020-02-15 21:33:31 +0100 |
| commit | 44b4c2db49f9d3283e04d4c34b5f4d22e66d0af4 (patch) | |
| tree | 02b2ccf4bc1edbf2f2e44c63a76d6e8d5285fb96 /Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp | |
| parent | 62046d93ce089659b49a1a5715c08fedf2af09a9 (diff) | |
Common: Avoid std::function overhead in ScopeGuard
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
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp')
0 files changed, 0 insertions, 0 deletions
