diff --git a/CMakeLists.txt b/CMakeLists.txt index dd80824a..7daf9471 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,8 @@ endif() if (NOT BOOST_ASYNC_BUILD_INLINE) find_package(Threads REQUIRED) - find_package(Boost REQUIRED container system json) + # Boost 1.82 is the first with a Boost.ASIO with necessary support + find_package(Boost 1.82 REQUIRED container system json) include_directories(include) endif() diff --git a/example/outcome.cpp b/example/outcome.cpp index 4b57fa23..0ba75f73 100644 --- a/example/outcome.cpp +++ b/example/outcome.cpp @@ -15,7 +15,7 @@ outcome_v2::awaitables::lazy lazy_func(int x) co_return x + 1; } -outcome_v2::awaitables::lazy eager_func(int x) +outcome_v2::awaitables::eager eager_func(int x) { co_return x + 1; } diff --git a/include/boost/async/config.hpp b/include/boost/async/config.hpp index 49977813..1b26553c 100644 --- a/include/boost/async/config.hpp +++ b/include/boost/async/config.hpp @@ -30,6 +30,10 @@ # endif #endif +#if BOOST_VERSION < 108200 +#error "Boost.Async needs Boost v1.82 or later otherwise the Boost.ASIO is missing needed support" +#endif + #if defined(_MSC_VER) // msvc doesn't correctly suspend for self-deletion, hence we must workaround here #define BOOST_ASYNC_NO_SELF_DELETE 1 diff --git a/readme.md b/readme.md index 9ba261d7..a47acbe1 100644 --- a/readme.md +++ b/readme.md @@ -5,13 +5,13 @@ This library works around that using more posts, which can cause slight differen ** This is not yet an official boost library. ** -This library provides a set of easy to use coroutine primitives & utilities. +This library provides a set of easy to use coroutine primitives & utilities for Boost.ASIO. A minimum of Boost 1.82 is necessary as the ASIO in that version has needed support. C++ 20 is needed for C++ coroutines. The assumptions are: - `io_context` is the execution_context of choice. - - Any `asio::io_context` is single threaded - - Eager execution is the way to go + - If `asio::io_context` is the executor, no more than one kernel thread executes within it at a time. + - Eager execution is the way to go. - A thread created with promise is only using promise stuff. ## Entry points