Léo Lam 44b4c2db49 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
2020-02-15 21:33:31 +01:00
..
2016-12-06 20:33:53 +01:00
2018-10-28 17:57:46 +00:00
2020-01-04 11:43:26 -08:00
2018-05-27 18:48:09 -04:00
2018-08-15 12:12:19 -05:00
2019-10-07 22:46:36 +02:00
2019-10-07 22:46:36 +02:00
2018-09-29 22:52:29 -07:00
2018-04-12 21:28:39 +02:00
2018-08-13 12:17:56 -07:00
2020-02-12 12:29:31 +01:00
2018-04-12 21:28:39 +02:00
2019-05-06 18:48:04 +00:00
2019-06-14 15:04:09 -04:00
2016-07-16 22:48:46 +02:00
2019-06-14 15:04:09 -04:00
2019-04-08 07:06:21 -04:00
2018-04-12 21:28:39 +02:00
2018-05-31 17:54:43 +02:00
2018-04-12 21:28:39 +02:00
2018-05-11 09:19:30 -04:00
2018-10-02 05:44:50 -04:00
2018-10-02 05:44:50 -04:00
2019-06-14 15:04:09 -04:00
2019-05-06 18:48:04 +00:00
2020-01-13 08:43:42 +01:00