Compatibility fixes with thread-safe list tracker changes.

This commit is contained in:
Jari Sundell
2025-03-11 12:38:04 +01:00
committed by GitHub
parent 37a5b7bccb
commit 0adfc17335
19 changed files with 207 additions and 302 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef RTORRENT_UTILS_FUNCTIONAL_H
#define RTORRENT_UTILS_FUNCTIONAL_H
#include <functional>
namespace utils {
// Create a class that calls a std::function when returning or exiting a scope.
class scope_guard {
public:
scope_guard(std::function<void()> on_exit_scope) : m_on_exit_scope(on_exit_scope) {}
~scope_guard() { m_on_exit_scope(); }
private:
std::function<void()> m_on_exit_scope;
};
} // namespace utils
#endif