#ifndef SHARED_SHARED_HH_ #define SHARED_SHARED_HH_ #include #include #include #include namespace shared { extern bool should_exit; void set_exit_handler(); class should_exit_exception : public std::exception {}; // This won't exist until c++24 lol class scoped_function { private: using func_t = std::function; func_t func; public: scoped_function(const func_t& f) : func(f) {} ~scoped_function() { this->func(); } }; } // namespace shared #endif