scope_guard/modules: Rename scope_guard to ScopeGuard

Using pascal case for the class name keeps it more consistent with the
majority of the other class names.
This commit is contained in:
Tamino Bauknecht
2023-10-23 14:59:46 +02:00
parent dd1de3efbf
commit 68dfd6aa3a
6 changed files with 15 additions and 15 deletions

View File

@ -5,14 +5,14 @@
namespace waybar::util {
template <typename Func>
class scope_guard {
class ScopeGuard {
public:
explicit scope_guard(Func&& exit_function) : f{std::forward<Func>(exit_function)} {}
scope_guard(const scope_guard&) = delete;
scope_guard(scope_guard&&) = default;
scope_guard& operator=(const scope_guard&) = delete;
scope_guard& operator=(scope_guard&&) = default;
~scope_guard() { f(); }
explicit ScopeGuard(Func&& exit_function) : f{std::forward<Func>(exit_function)} {}
ScopeGuard(const ScopeGuard&) = delete;
ScopeGuard(ScopeGuard&&) = default;
ScopeGuard& operator=(const ScopeGuard&) = delete;
ScopeGuard& operator=(ScopeGuard&&) = default;
~ScopeGuard() { f(); }
private:
Func f;