mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
#include "platform/platform.hpp"
|
||||
|
||||
#include <future>
|
||||
#include <functional>
|
||||
#include <future>
|
||||
#include <utility>
|
||||
|
||||
namespace platform
|
||||
@@ -14,22 +14,17 @@ class SafeCallback;
|
||||
// Calls callback on main thread, all params are copied.
|
||||
// If not initialized nothing will be done.
|
||||
// *NOTE* The class is not thread-safe.
|
||||
template <typename R, typename ...Args>
|
||||
template <typename R, typename... Args>
|
||||
class SafeCallback<R(Args...)>
|
||||
{
|
||||
public:
|
||||
SafeCallback() = default;
|
||||
|
||||
template <typename Fn>
|
||||
SafeCallback(Fn const & fn)
|
||||
: m_fn(fn)
|
||||
{
|
||||
}
|
||||
SafeCallback(Fn const & fn) : m_fn(fn)
|
||||
{}
|
||||
|
||||
operator bool() const noexcept
|
||||
{
|
||||
return static_cast<bool>(m_fn);
|
||||
}
|
||||
operator bool() const noexcept { return static_cast<bool>(m_fn); }
|
||||
|
||||
void operator()(Args... args) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user