mirror of
https://github.com/Naios/continuable.git
synced 2026-02-13 13:49:49 +08:00
minor improvements
This commit is contained in:
parent
444af12a6d
commit
e5d39c4b0a
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "functional_unwrap.hpp"
|
#include "functional_unwrap.hpp"
|
||||||
|
|
||||||
/// A general purpose Callback type (Callable/Invokeable)
|
/// A general purpose Callback type (Callable/ Invokeable)
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
using Callback = std::function<void(Args...)>;
|
using Callback = std::function<void(Args...)>;
|
||||||
|
|
||||||
@ -66,8 +66,8 @@ namespace detail
|
|||||||
return [=](Args&&... args)
|
return [=](Args&&... args)
|
||||||
{
|
{
|
||||||
if (auto const callback = weak.lock())
|
if (auto const callback = weak.lock())
|
||||||
// FIXME: use std::forward
|
// FIXME: use std::forward
|
||||||
(*callback)(args...);
|
(*callback)(args...);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -113,4 +113,4 @@ inline auto make_weak_wrapped_callback(_CTy const& callback)
|
|||||||
return detail::WeakProxyFactory<_CTy>::CreateProxy(callback);
|
return detail::WeakProxyFactory<_CTy>::CreateProxy(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /// _CALLBACK_H_
|
#endif // _CALLBACK_H_
|
||||||
|
|||||||
@ -78,4 +78,4 @@ inline auto make_continuable(_FTy&& functional)
|
|||||||
return detail::continuable_factory_t<_FTy>::CreateFrom(std::forward<_FTy>(functional));
|
return detail::continuable_factory_t<_FTy>::CreateFrom(std::forward<_FTy>(functional));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /// _CONTINUABLE_H_
|
#endif // _CONTINUABLE_H_
|
||||||
|
|||||||
@ -122,4 +122,4 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /// _WEAK_CALLBACK_CONTAINER_H_
|
#endif // _WEAK_CALLBACK_CONTAINER_H_
|
||||||
|
|||||||
@ -28,10 +28,9 @@
|
|||||||
|
|
||||||
namespace fu
|
namespace fu
|
||||||
{
|
{
|
||||||
|
/// Identity class which is used to carry parameter packs.
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
struct identity
|
struct identity { };
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user