chore: Introduce common directory to deduplicate shared code

This commit is contained in:
Ash Logan 2024-11-21 13:19:06 +11:00
commit ea71879bb1
22 changed files with 110 additions and 278 deletions

View file

@ -1,13 +0,0 @@
#pragma once
#include <functional>
// https://stackoverflow.com/a/61242721
template<typename F>
struct scope_exit
{
F func;
explicit scope_exit(F&& f): func(std::forward<F>(f)) {}
~scope_exit() { func(); }
};
template<typename F> scope_exit(F&& frv) -> scope_exit<F>;