mirror of
https://github.com/Naios/continuable.git
synced 2025-12-08 09:47:43 +08:00
unix build fix
This commit is contained in:
parent
41def1a390
commit
cb56f19906
@ -96,36 +96,6 @@ namespace detail
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct convert_void_to_continuable<void>
|
||||
{
|
||||
typedef _ContinuableImpl<DefaultContinuableState, Callback<>> type;
|
||||
|
||||
template<typename Fn, typename... Args>
|
||||
static type invoke(Fn functional, Args... args)
|
||||
{
|
||||
// Invoke the void returning functional
|
||||
functional(std::forward<Args>(args)...);
|
||||
|
||||
// Return a fake void continuable
|
||||
return type([](Callback<>&&)
|
||||
{
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
template<typename _State, typename _CTy>
|
||||
struct convert_void_to_continuable<_ContinuableImpl<_State, _CTy>>
|
||||
{
|
||||
typedef _ContinuableImpl<_State, _CTy> type;
|
||||
|
||||
template<typename Fn, typename... Args>
|
||||
static type invoke(Fn functional, Args... args)
|
||||
{
|
||||
return functional(std::forward<Args>(args)...);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... _STy, typename... _ATy>
|
||||
class _ContinuableImpl<ContinuableState<_STy...>, std::function<void(_ATy...)>>
|
||||
{
|
||||
@ -251,6 +221,36 @@ namespace detail
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct convert_void_to_continuable<void>
|
||||
{
|
||||
typedef _ContinuableImpl<DefaultContinuableState, Callback<>> type;
|
||||
|
||||
template<typename Fn, typename... Args>
|
||||
static type invoke(Fn functional, Args... args)
|
||||
{
|
||||
// Invoke the void returning functional
|
||||
functional(std::forward<Args>(args)...);
|
||||
|
||||
// Return a fake void continuable
|
||||
return type([](Callback<>&&)
|
||||
{
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
template<typename _State, typename _CTy>
|
||||
struct convert_void_to_continuable<_ContinuableImpl<_State, _CTy>>
|
||||
{
|
||||
typedef _ContinuableImpl<_State, _CTy> type;
|
||||
|
||||
template<typename Fn, typename... Args>
|
||||
static type invoke(Fn functional, Args... args)
|
||||
{
|
||||
return functional(std::forward<Args>(args)...);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// A continuable provides useful methods to react on the result of callbacks
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user