Promote is_continuable to the public API

This commit is contained in:
Denis Blank 2018-02-10 01:37:38 +01:00
parent 7c0aa6e6ba
commit cd42a7b2ba
2 changed files with 8 additions and 3 deletions

View File

@ -44,6 +44,11 @@
#include <continuable/detail/util.hpp>
namespace cti {
/// Deduces to a true_type if the given type is a continuable_base.
///
/// \since 3.0.0
using detail::base::is_continuable;
/// The main class of the continuable library, it provides the functionality
/// for chaining callbacks and continuations together to a unified hierarchy.
///

View File

@ -63,9 +63,9 @@ namespace detail {
/// -> void
namespace base {
template <typename T>
struct is_continuation : std::false_type {};
struct is_continuable : std::false_type {};
template <typename Data, typename Annotation>
struct is_continuation<continuable_base<Data, Annotation>> : std::true_type {};
struct is_continuable<continuable_base<Data, Annotation>> : std::true_type {};
/// Helper class to access private methods and members of
/// the continuable_base class.
@ -501,7 +501,7 @@ template <handle_results HandleResults, handle_errors HandleErrors,
typename Continuation, typename Callback, typename Executor>
auto chain_continuation(Continuation&& continuation, Callback&& callback,
Executor&& executor) {
static_assert(is_continuation<std::decay_t<Continuation>>{},
static_assert(is_continuable<std::decay_t<Continuation>>{},
"Expected a continuation!");
using Hint = decltype(hints::hint_of(traits::identity_of(continuation)));