#pragma once #include namespace ThreadUtils { class CRethrow { private: std::function m_rethrow; public: bool exec( std::function f ) throw(); void rethrow() const; bool didFail() const { return !! m_rethrow; } void clear() { m_rethrow = nullptr; } }; }