9 #define QUICR_DEFER_CONCAT(a, b) QUICR_DEFER_CONCAT_INNER(a, b)
12 #define QUICR_DEFER_CONCAT_INNER(a, b) a##b
14 #if defined(__clang__) && __clang_major__ >= 21
16 #define QUICR_DEFER_PUSH \
17 _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wthread-safety-analysis\"")
20 #define QUICR_DEFER_POP _Pragma("clang diagnostic pop")
23 #define QUICR_DEFER_PUSH
26 #define QUICR_DEFER_POP
36 quicr::ScopeGuard QUICR_DEFER_CONCAT(defer_, __LINE__)([&]() { \
57 : func(std::forward<F>(f))
Non-copyable RAII guard that invokes a callable at scope exit.
Definition: defer.h:49
~ScopeGuard() noexcept
Invokes the stored callable.
Definition: defer.h:71
ScopeGuard & operator=(const ScopeGuard &other)=delete
Scope guards cannot be copy-assigned.
ScopeGuard(F &&f)
Takes ownership of a callable to run at destruction.
Definition: defer.h:56
ScopeGuard(const ScopeGuard &other)=delete
Scope guards cannot be copied.
Definition: attributes.h:13