comparison foosdk/sdk/foobar2000/helpers/rethrow.h @ 1:20d02a178406 default tip

*: check in everything else yay
author Paper <paper@tflc.us>
date Mon, 05 Jan 2026 02:15:46 -0500
parents
children
comparison
equal deleted inserted replaced
0:e9bb126753e7 1:20d02a178406
1 #pragma once
2
3 #include <functional>
4
5 #include <exception>
6
7 namespace ThreadUtils {
8 class CRethrow {
9 private:
10 std::exception_ptr m_exception;
11 public:
12 bool exec( std::function<void () > f ) throw();
13 void rethrow() const;
14 bool didFail() const { return !!m_exception; }
15 void clear() { m_exception = nullptr; }
16 };
17 }