thoughts about a helper class

This commit is contained in:
Naios 2015-08-09 13:59:53 +02:00
parent e41bd1a531
commit 88ba45dd06

View File

@ -42,12 +42,26 @@ struct Continuable
} }
}; };
// helper class
struct Continuables
{
static Continuable<> create_empty()
{
return make_continuable([](std::function<void()>&& callback)
{
callback();
});
}
};
template <typename... Args> template <typename... Args>
Continuable<> make_continuable(Args&&...) Continuable<> make_continuable(Args&&...)
{ {
return Continuable<>(); return Continuable<>();
} }
template <typename... LeftArgs, typename... RightArgs> template <typename... LeftArgs, typename... RightArgs>
Continuable<> operator&& (Continuable<LeftArgs...>&&, Continuable<RightArgs...>&&) Continuable<> operator&& (Continuable<LeftArgs...>&&, Continuable<RightArgs...>&&)
{ {