mirror of
https://github.com/Naios/continuable.git
synced 2025-12-09 18:26:46 +08:00
fix codestyle
This commit is contained in:
parent
6dc592ad6b
commit
d2f6f1f4b0
@ -58,24 +58,24 @@ namespace detail
|
||||
template<typename... Args>
|
||||
struct WeakProxyFactory<std::weak_ptr<std::function<void(Args...)>>>
|
||||
{
|
||||
static Callback<Args...> CreateProxy(WeakCallback<Args...> const& weak)
|
||||
{
|
||||
return [=](Args&&... args)
|
||||
static Callback<Args...> CreateProxy(WeakCallback<Args...> const& weak)
|
||||
{
|
||||
return [=](Args&&... args)
|
||||
{
|
||||
if (auto const callback = weak.lock())
|
||||
// FIXME: use std::forward
|
||||
(*callback)(args...);
|
||||
// FIXME: use std::forward
|
||||
(*callback)(args...);
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Args>
|
||||
struct WeakProxyFactory<std::shared_ptr<std::function<void(Args...)>>>
|
||||
{
|
||||
static Callback<Args...> CreateProxy(SharedCallback<Args...> const& shared)
|
||||
{
|
||||
return WeakProxyFactory<std::weak_ptr<std::function<void(Args...)>>>::CreateProxy(shared);
|
||||
}
|
||||
static Callback<Args...> CreateProxy(SharedCallback<Args...> const& shared)
|
||||
{
|
||||
return WeakProxyFactory<std::weak_ptr<std::function<void(Args...)>>>::CreateProxy(shared);
|
||||
}
|
||||
};
|
||||
|
||||
} // detail
|
||||
@ -97,7 +97,7 @@ inline shared_callback_of_t<_CTy>
|
||||
(std::forward<callback_of_t<_CTy>>(callback));
|
||||
};
|
||||
|
||||
/// Creates a weak callback which wrapps the given shared or weak callback.
|
||||
/// Creates a weak callback which wraps the given shared or weak callback.
|
||||
/// If the given managed callback expires the callback is not invoked anymore.
|
||||
template<typename _CTy>
|
||||
inline auto make_weak_wrapped_callback(_CTy const& callback)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user