Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions include/boost/capy/concept/io_awaitable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <boost/capy/detail/config.hpp>
#include <coroutine>
#include <boost/capy/ex/io_env.hpp>
#include <ranges>

namespace boost {
namespace capy {
Expand Down Expand Up @@ -121,6 +122,19 @@ concept IoAwaitable =
template<typename A>
using awaitable_result_t = decltype(std::declval<std::decay_t<A>&>().await_resume());

/** Concept for ranges of I/O awaitables.

A range satisfies `IoAwaitableRange` if it is a sized input range
whose value type satisfies @ref IoAwaitable.

@tparam R The range type.
*/
template<typename R>
concept IoAwaitableRange =
std::ranges::input_range<R> &&
std::ranges::sized_range<R> &&
IoAwaitable<std::ranges::range_value_t<R>>;

} // namespace capy
} // namespace boost

Expand Down
Loading
Loading