From b9205c214cc0da6e52e97618b6f087e2fd9b7ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 18 Jul 2026 22:41:36 +0100 Subject: [PATCH 1/4] fix header names --- README.md | 4 ++-- examples/affinity.cpp | 4 ++-- examples/aggregate_return.cpp | 4 ++-- examples/alloc.cpp | 4 ++-- examples/async_lock.cpp | 4 ++-- examples/co_await_result.cpp | 4 ++-- examples/container.cpp | 4 ++-- examples/cppnow_affinity.cpp | 6 +++--- examples/cppnow_allocator.cpp | 4 ++-- examples/cppnow_basic.cpp | 4 ++-- examples/cppnow_cancel.cpp | 4 ++-- examples/cppnow_errors.cpp | 4 ++-- examples/cppnow_query.cpp | 4 ++-- examples/cppnow_result_types.cpp | 4 ++-- examples/cppnow_return.cpp | 4 ++-- examples/cppnow_stop_token.cpp | 6 +++--- examples/cppnow_with_error.cpp | 4 ++-- examples/customize.cpp | 4 ++-- examples/dangling_references.cpp | 4 ++-- examples/environment.cpp | 6 +++--- examples/error.cpp | 4 ++-- examples/escaped_exception.cpp | 4 ++-- examples/friendly.cpp | 4 ++-- examples/into_optional.cpp | 4 ++-- examples/loop.cpp | 4 ++-- examples/query.cpp | 4 ++-- examples/result_example.cpp | 4 ++-- examples/rvalue_task.cpp | 4 ++-- examples/stop.cpp | 6 +++--- examples/task_scheduler.cpp | 4 ++-- include/beman/task.hpp | 9 +++++++++ include/beman/task/detail/allocator_of.hpp | 2 +- include/beman/task/detail/allocator_support.hpp | 2 +- include/beman/task/detail/find_allocator.hpp | 2 +- include/beman/task/detail/poly.hpp | 2 +- include/beman/task/detail/promise_base.hpp | 2 +- include/beman/task/detail/result_type.hpp | 6 +++--- include/beman/task/detail/scheduler_of.hpp | 2 +- include/beman/task/detail/sub_visit.hpp | 4 ++-- include/beman/task/detail/task_scheduler.hpp | 2 +- include/beman/task/detail/with_error.hpp | 2 +- include/beman/task/task.hpp | 2 +- src/beman/task/CMakeLists.txt | 1 + tests/beman/task/task.test.cpp | 4 ++-- 44 files changed, 90 insertions(+), 80 deletions(-) create mode 100644 include/beman/task.hpp diff --git a/README.md b/README.md index a474b89..7610884 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ using sender/receiver facilities to implement version of `hello, world`: ```cpp -#include -#include +#include +#include #include namespace ex = beman::execution; diff --git a/examples/affinity.cpp b/examples/affinity.cpp index c7c46ed..da815b4 100644 --- a/examples/affinity.cpp +++ b/examples/affinity.cpp @@ -1,8 +1,8 @@ // examples/affinity.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include "demo_thread_loop.hpp" #include #include diff --git a/examples/aggregate_return.cpp b/examples/aggregate_return.cpp index 2f52c83..3e8c5c4 100644 --- a/examples/aggregate_return.cpp +++ b/examples/aggregate_return.cpp @@ -1,8 +1,8 @@ // examples/aggregate_return.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include namespace ex = beman::execution; diff --git a/examples/alloc.cpp b/examples/alloc.cpp index 5d01db5..78b5baa 100644 --- a/examples/alloc.cpp +++ b/examples/alloc.cpp @@ -7,8 +7,8 @@ #include #include #include -#include -#include +#include +#include namespace ex = beman::execution; diff --git a/examples/async_lock.cpp b/examples/async_lock.cpp index d5e5a6b..b13796b 100644 --- a/examples/async_lock.cpp +++ b/examples/async_lock.cpp @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include namespace ex = beman::execution; diff --git a/examples/co_await_result.cpp b/examples/co_await_result.cpp index 8ab6403..4989933 100644 --- a/examples/co_await_result.cpp +++ b/examples/co_await_result.cpp @@ -1,8 +1,8 @@ // examples/co_await_result.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include diff --git a/examples/container.cpp b/examples/container.cpp index 7a538f2..4ed74ab 100644 --- a/examples/container.cpp +++ b/examples/container.cpp @@ -1,8 +1,8 @@ // examples/container.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include #include diff --git a/examples/cppnow_affinity.cpp b/examples/cppnow_affinity.cpp index 3caa767..f087502 100644 --- a/examples/cppnow_affinity.cpp +++ b/examples/cppnow_affinity.cpp @@ -1,9 +1,9 @@ // examples/cppnow_affinity.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include -#include +#include +#include +#include #include "demo_thread_loop.hpp" #include #include diff --git a/examples/cppnow_allocator.cpp b/examples/cppnow_allocator.cpp index 748d2f8..5e5772c 100644 --- a/examples/cppnow_allocator.cpp +++ b/examples/cppnow_allocator.cpp @@ -1,8 +1,8 @@ // examples/cppnow_alloctor.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include diff --git a/examples/cppnow_basic.cpp b/examples/cppnow_basic.cpp index 210f455..3bc6be5 100644 --- a/examples/cppnow_basic.cpp +++ b/examples/cppnow_basic.cpp @@ -1,8 +1,8 @@ // examples/cppnow_basic.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include diff --git a/examples/cppnow_cancel.cpp b/examples/cppnow_cancel.cpp index eca67e0..3953cf5 100644 --- a/examples/cppnow_cancel.cpp +++ b/examples/cppnow_cancel.cpp @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // ---------------------------------------------------------------------------- -#include -#include +#include +#include namespace ex = beman::execution; diff --git a/examples/cppnow_errors.cpp b/examples/cppnow_errors.cpp index 1279efd..76bf932 100644 --- a/examples/cppnow_errors.cpp +++ b/examples/cppnow_errors.cpp @@ -1,8 +1,8 @@ // examples/cppnow_errors.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include #include diff --git a/examples/cppnow_query.cpp b/examples/cppnow_query.cpp index 4a12e22..e5c6ebc 100644 --- a/examples/cppnow_query.cpp +++ b/examples/cppnow_query.cpp @@ -1,8 +1,8 @@ // examples/cppnow_query.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include namespace ex = beman::execution; diff --git a/examples/cppnow_result_types.cpp b/examples/cppnow_result_types.cpp index 2c1d3fa..4cf7477 100644 --- a/examples/cppnow_result_types.cpp +++ b/examples/cppnow_result_types.cpp @@ -1,8 +1,8 @@ // examples/cppnow_result_types.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include namespace ex = beman::execution; diff --git a/examples/cppnow_return.cpp b/examples/cppnow_return.cpp index e8e9445..311f769 100644 --- a/examples/cppnow_return.cpp +++ b/examples/cppnow_return.cpp @@ -1,8 +1,8 @@ // examples/cppnow_return.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include namespace ex = beman::execution; diff --git a/examples/cppnow_stop_token.cpp b/examples/cppnow_stop_token.cpp index 5fd6d50..ae576c3 100644 --- a/examples/cppnow_stop_token.cpp +++ b/examples/cppnow_stop_token.cpp @@ -1,9 +1,9 @@ // examples/cppnow_stop_token.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/examples/cppnow_with_error.cpp b/examples/cppnow_with_error.cpp index afc6528..c1a2229 100644 --- a/examples/cppnow_with_error.cpp +++ b/examples/cppnow_with_error.cpp @@ -1,8 +1,8 @@ // examples/cppnow_with_error.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include diff --git a/examples/customize.cpp b/examples/customize.cpp index 41e5d80..a1d45b1 100644 --- a/examples/customize.cpp +++ b/examples/customize.cpp @@ -1,8 +1,8 @@ // examples/customize.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include #include diff --git a/examples/dangling_references.cpp b/examples/dangling_references.cpp index a97cf94..8010a07 100644 --- a/examples/dangling_references.cpp +++ b/examples/dangling_references.cpp @@ -1,8 +1,8 @@ // examples/dangling_references.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include #include diff --git a/examples/environment.cpp b/examples/environment.cpp index f23e8c5..2cfa7c4 100644 --- a/examples/environment.cpp +++ b/examples/environment.cpp @@ -2,9 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #ifndef _MSC_VER -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/examples/error.cpp b/examples/error.cpp index ca4c14b..4db3b30 100644 --- a/examples/error.cpp +++ b/examples/error.cpp @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include namespace ex = beman::execution; diff --git a/examples/escaped_exception.cpp b/examples/escaped_exception.cpp index a041f04..a22e968 100644 --- a/examples/escaped_exception.cpp +++ b/examples/escaped_exception.cpp @@ -1,8 +1,8 @@ // examples/escaped_exception.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include diff --git a/examples/friendly.cpp b/examples/friendly.cpp index adb9213..2712a66 100644 --- a/examples/friendly.cpp +++ b/examples/friendly.cpp @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include namespace ex = beman::execution; diff --git a/examples/into_optional.cpp b/examples/into_optional.cpp index badfd2c..2c83dde 100644 --- a/examples/into_optional.cpp +++ b/examples/into_optional.cpp @@ -5,8 +5,8 @@ #include #include #include -#include -#include +#include +#include namespace ex = beman::execution; diff --git a/examples/loop.cpp b/examples/loop.cpp index 766e7af..d9e3602 100644 --- a/examples/loop.cpp +++ b/examples/loop.cpp @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include #include namespace ex = beman::execution; diff --git a/examples/query.cpp b/examples/query.cpp index d0db8e1..c09bfaa 100644 --- a/examples/query.cpp +++ b/examples/query.cpp @@ -1,8 +1,8 @@ // examples/query.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include #include diff --git a/examples/result_example.cpp b/examples/result_example.cpp index fb52c73..4219cde 100644 --- a/examples/result_example.cpp +++ b/examples/result_example.cpp @@ -1,8 +1,8 @@ // examples/result_example.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include namespace ex = beman::execution; diff --git a/examples/rvalue_task.cpp b/examples/rvalue_task.cpp index 640a317..ba5db1f 100644 --- a/examples/rvalue_task.cpp +++ b/examples/rvalue_task.cpp @@ -1,8 +1,8 @@ // examples/rvalue_task.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include namespace ex = beman::execution; diff --git a/examples/stop.cpp b/examples/stop.cpp index bc5d183..bfe5eff 100644 --- a/examples/stop.cpp +++ b/examples/stop.cpp @@ -1,9 +1,9 @@ // examples/stop.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/examples/task_scheduler.cpp b/examples/task_scheduler.cpp index c02f5ce..9defade 100644 --- a/examples/task_scheduler.cpp +++ b/examples/task_scheduler.cpp @@ -1,8 +1,8 @@ // examples/task_scheduler.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include #include diff --git a/include/beman/task.hpp b/include/beman/task.hpp new file mode 100644 index 0000000..02fa962 --- /dev/null +++ b/include/beman/task.hpp @@ -0,0 +1,9 @@ +// include/beman/task.hpp -*-C++-*- +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#ifndef INCLUDED_INCLUDE_BEMAN_TASK +#define INCLUDED_INCLUDE_BEMAN_TASK + +#include + +#endif diff --git a/include/beman/task/detail/allocator_of.hpp b/include/beman/task/detail/allocator_of.hpp index e319c18..1ea51b4 100644 --- a/include/beman/task/detail/allocator_of.hpp +++ b/include/beman/task/detail/allocator_of.hpp @@ -12,7 +12,7 @@ namespace beman::task::detail { /*! * \brief Utility to get an allocator type from a context - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ template diff --git a/include/beman/task/detail/allocator_support.hpp b/include/beman/task/detail/allocator_support.hpp index a3d3979..06c18f2 100644 --- a/include/beman/task/detail/allocator_support.hpp +++ b/include/beman/task/detail/allocator_support.hpp @@ -16,7 +16,7 @@ namespace beman::task::detail { /*! * \brief Utility adding allocator support to type by embedding the allocator - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * * To add allocator support using this class just publicly inherit from * allocator_support. This utility is probably diff --git a/include/beman/task/detail/find_allocator.hpp b/include/beman/task/detail/find_allocator.hpp index 0b21208..b2a3820 100644 --- a/include/beman/task/detail/find_allocator.hpp +++ b/include/beman/task/detail/find_allocator.hpp @@ -11,7 +11,7 @@ namespace beman::task::detail { /*! * \brief Utility locating an allocator_arg/allocator pair - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ template diff --git a/include/beman/task/detail/poly.hpp b/include/beman/task/detail/poly.hpp index a48f92f..a82e4fd 100644 --- a/include/beman/task/detail/poly.hpp +++ b/include/beman/task/detail/poly.hpp @@ -14,7 +14,7 @@ namespace beman::task::detail { /*! * \brief Utility providing small object optimization and type erasure. - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ template diff --git a/include/beman/task/detail/promise_base.hpp b/include/beman/task/detail/promise_base.hpp index 787577b..863d587 100644 --- a/include/beman/task/detail/promise_base.hpp +++ b/include/beman/task/detail/promise_base.hpp @@ -16,7 +16,7 @@ namespace beman::task::detail { /* * \brief Helper base class dealing with void vs. value results. - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ template <::beman::task::detail::stoppable Stop, typename Value, typename Environment> diff --git a/include/beman/task/detail/result_type.hpp b/include/beman/task/detail/result_type.hpp index 7a8bffe..5c90f7c 100644 --- a/include/beman/task/detail/result_type.hpp +++ b/include/beman/task/detail/result_type.hpp @@ -16,20 +16,20 @@ namespace beman::task::detail { /** * \brief Helper type used as a placeholder for a void result - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ enum void_type : unsigned char {}; /** * \brief Helper type indicating whether a stopped result is possible - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ enum class stoppable { yes, no }; /** * \brief Type to hold the result of a coroutine - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp */ template <::beman::task::detail::stoppable Stop, typename Value, typename Errors> class result_type; diff --git a/include/beman/task/detail/scheduler_of.hpp b/include/beman/task/detail/scheduler_of.hpp index 35da97e..8bd2fe1 100644 --- a/include/beman/task/detail/scheduler_of.hpp +++ b/include/beman/task/detail/scheduler_of.hpp @@ -12,7 +12,7 @@ namespace beman::task::detail { /*! * \brief Utility to get a scheduler type from a context - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ template diff --git a/include/beman/task/detail/sub_visit.hpp b/include/beman/task/detail/sub_visit.hpp index e4ca452..5f17bf1 100644 --- a/include/beman/task/detail/sub_visit.hpp +++ b/include/beman/task/detail/sub_visit.hpp @@ -15,7 +15,7 @@ namespace beman::task::detail { /* * \brief Helper function creatig thunks for a variant visit. - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ template @@ -27,7 +27,7 @@ void sub_visit_thunks(Fun& fun, Var& var, std::index_sequence) { /* * \brief Helper function visiting a suffix of variant options - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ template diff --git a/include/beman/task/detail/task_scheduler.hpp b/include/beman/task/detail/task_scheduler.hpp index 89b3365..018ce7b 100644 --- a/include/beman/task/detail/task_scheduler.hpp +++ b/include/beman/task/detail/task_scheduler.hpp @@ -17,7 +17,7 @@ namespace beman::task::detail { /*! * \brief Type-erasing scheduler - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * * The class `task_scheduler` is used to type-erase any scheduler class. * Any error produced by the underlying scheduler except `std::error_code` is turned into diff --git a/include/beman/task/detail/with_error.hpp b/include/beman/task/detail/with_error.hpp index 2b0a7ef..fe04ca6 100644 --- a/include/beman/task/detail/with_error.hpp +++ b/include/beman/task/detail/with_error.hpp @@ -10,7 +10,7 @@ // ---------------------------------------------------------------------------- /* * \brief Tag type used to indicate an error is produced. - * \headerfile beman/task/task.hpp + * \headerfile beman/task.hpp * \internal */ namespace beman::task::detail { diff --git a/include/beman/task/task.hpp b/include/beman/task/task.hpp index 60d134d..18947ec 100644 --- a/include/beman/task/task.hpp +++ b/include/beman/task/task.hpp @@ -4,7 +4,7 @@ #ifndef INCLUDED_INCLUDE_BEMAN_TASK_TASK #define INCLUDED_INCLUDE_BEMAN_TASK_TASK -#include +#include #include #include #include diff --git a/src/beman/task/CMakeLists.txt b/src/beman/task/CMakeLists.txt index cc06e70..e307722 100644 --- a/src/beman/task/CMakeLists.txt +++ b/src/beman/task/CMakeLists.txt @@ -10,6 +10,7 @@ target_sources( FILE_SET HEADERS BASE_DIRS ${PROJECT_SOURCE_DIR}/include FILES + ${PROJECT_SOURCE_DIR}/include/beman/task.hpp ${PROJECT_SOURCE_DIR}/include/beman/execution/task.hpp ${PROJECT_SOURCE_DIR}/include/beman/lazy/lazy.hpp ${PROJECT_SOURCE_DIR}/include/beman/task/task.hpp diff --git a/tests/beman/task/task.test.cpp b/tests/beman/task/task.test.cpp index 26c3dc7..d474f43 100644 --- a/tests/beman/task/task.test.cpp +++ b/tests/beman/task/task.test.cpp @@ -1,8 +1,8 @@ // tests/beman/task/task.test.cpp -*-C++-*- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#include -#include +#include +#include #include namespace ex = beman::execution; From b364916de8c4b2401536fdc6a69e50a10ec4904a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sat, 18 Jul 2026 22:52:56 +0100 Subject: [PATCH 2/4] fix compiler explorer link to point to an [eventually] working example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7610884..4fe4a3a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception --> -[![Library Status](https://raw.githubusercontent.com/bemanproject/beman/refs/heads/main/images/badges/beman_badge-beman_library_under_development.svg)](https://github.com/bemanproject/beman/blob/main/docs/beman_library_maturity_model.md#the-beman-library-maturity-model)![Standard Target](https://github.com/bemanproject/beman/blob/main/images/badges/cpp26.svg)[![Coverage](https://coveralls.io/repos/github/bemanproject/task/badge.svg?branch=main)](https://coveralls.io/github/bemanproject/task?branch=main)[![Compiler Explorer Example](https://img.shields.io/badge/Try%20it%20on%20Compiler%20Explorer-grey?logo=compilerexplorer&logoColor=67c52a)](https://godbolt.org/z/e1sjsT46r) +[![Library Status](https://raw.githubusercontent.com/bemanproject/beman/refs/heads/main/images/badges/beman_badge-beman_library_under_development.svg)](https://github.com/bemanproject/beman/blob/main/docs/beman_library_maturity_model.md#the-beman-library-maturity-model)![Standard Target](https://github.com/bemanproject/beman/blob/main/images/badges/cpp26.svg)[![Coverage](https://coveralls.io/repos/github/bemanproject/task/badge.svg?branch=main)](https://coveralls.io/github/bemanproject/task?branch=main)[![Compiler Explorer Example](https://img.shields.io/badge/Try%20it%20on%20Compiler%20Explorer-grey?logo=compilerexplorer&logoColor=67c52a)](https://godbolt.org/z/anYY59nYd) `beman::execution::task` is a class template which From 6b5cadcdcdaa6501df52da0d8661347cce244827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 19 Jul 2026 16:08:50 +0100 Subject: [PATCH 3/4] fixed some examples --- examples/CMakeLists.txt | 8 +++---- examples/cppnow_query.cpp | 5 ++--- examples/cppnow_stop_token.cpp | 2 +- examples/into_optional.cpp | 12 ++++++++--- examples/query.cpp | 4 ++-- examples/stop.cpp | 2 +- include/beman/task/detail/into_optional.hpp | 23 ++++++++++++--------- 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 6704c50..b2bdeb1 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -45,10 +45,10 @@ if(NOT MSVC) issue_affine cppnow_affinity cppnow_basic - # FIXME: cppnow_query + cppnow_query cppnow_result_types cppnow_return - # FIXME: cppnow_stop_token + cppnow_stop_token cppnow_with_error co_await_result co_await_task @@ -57,9 +57,9 @@ if(NOT MSVC) friendly hello issue_frame_allocator - # FIXME: query + query result_example - # FIXME: stop + stop ) endif() diff --git a/examples/cppnow_query.cpp b/examples/cppnow_query.cpp index e5c6ebc..a408906 100644 --- a/examples/cppnow_query.cpp +++ b/examples/cppnow_query.cpp @@ -6,7 +6,6 @@ #include namespace ex = beman::execution; -namespace exd = beman::execution::detail; // ---------------------------------------------------------------------------- @@ -61,6 +60,6 @@ ex::task with_fancy_env() { } // namespace int main() { - ex::sync_wait(exd::write_env(with_env(), exd::make_env(get_value, 17))); - ex::sync_wait(exd::write_env(with_fancy_env(), exd::make_env(get_value, 17))); + ex::sync_wait(ex::write_env(with_env(), ex::detail::make_env(get_value, 17))); + ex::sync_wait(ex::write_env(with_fancy_env(), ex::detail::make_env(get_value, 17))); } diff --git a/examples/cppnow_stop_token.cpp b/examples/cppnow_stop_token.cpp index ae576c3..182e274 100644 --- a/examples/cppnow_stop_token.cpp +++ b/examples/cppnow_stop_token.cpp @@ -29,7 +29,7 @@ int main() { ex::inplace_stop_source source; std::thread thread([&] { - ex::sync_wait(ex::detail::write_env(stopping(), ex::detail::make_env(ex::get_stop_token, source.get_token()))); + ex::sync_wait(ex::write_env(stopping(), ex::detail::make_env(ex::get_stop_token, source.get_token()))); }); std::this_thread::sleep_for(100ms); diff --git a/examples/into_optional.cpp b/examples/into_optional.cpp index 2c83dde..0986a85 100644 --- a/examples/into_optional.cpp +++ b/examples/into_optional.cpp @@ -15,6 +15,10 @@ template struct multi_sender { using sender_concept = ex::sender_tag; using completion_signatures = ex::completion_signatures; + template + static consteval auto get_completion_signatures() { + return completion_signatures{}; + } template auto connect(Receiver&& receiver) const { @@ -69,8 +73,10 @@ auto my_into_optional(S&& s) { int main() { queue que; ex::sync_wait([](auto& q) -> ex::task<> { - // auto x = co_await ex::just(true) | into_optional; - [[maybe_unused]] std::optional x = co_await (q.async_pop() | ex::into_optional); - [[maybe_unused]] std::optional y = co_await ex::into_optional(q.async_pop()); + static_assert(std::same_as())>); + // auto x = co_await (ex::just(true) | ex::into_optional); + // [[maybe_unused]] std::optional x = co_await (q.async_pop() | ex::into_optional); + // [[maybe_unused]] std::optional y = co_await ex::into_optional(q.async_pop()); + co_return; }(que)); } diff --git a/examples/query.cpp b/examples/query.cpp index c09bfaa..e3b5036 100644 --- a/examples/query.cpp +++ b/examples/query.cpp @@ -49,13 +49,13 @@ struct context { }; int main() { - ex::sync_wait(ex::detail::write_env( + ex::sync_wait(ex::write_env( []() -> ex::task { auto value(co_await ex::read_env(get_value)); std::cout << "value=" << value << "\n"; }(), ex::detail::make_env(get_value, 42))); - ex::sync_wait(ex::detail::write_env( + ex::sync_wait(ex::write_env( []() -> ex::task { auto value(co_await ex::read_env(get_value)); std::cout << "value=" << value << "\n"; diff --git a/examples/stop.cpp b/examples/stop.cpp index bfe5eff..74c4aad 100644 --- a/examples/stop.cpp +++ b/examples/stop.cpp @@ -33,7 +33,7 @@ int main() { }; }; - auto [result] = ex::sync_wait(ex::detail::write_env( + auto [result] = ex::sync_wait(ex::write_env( []() -> ex::task { auto token(co_await ex::read_env(ex::get_stop_token)); std::uint64_t count{}; diff --git a/include/beman/task/detail/into_optional.hpp b/include/beman/task/detail/into_optional.hpp index 7bef831..f5b4fce 100644 --- a/include/beman/task/detail/into_optional.hpp +++ b/include/beman/task/detail/into_optional.hpp @@ -15,8 +15,8 @@ namespace beman::task::detail { inline constexpr struct into_optional_t : beman::execution::sender_adaptor_closure { template <::beman::execution::sender Upstream> struct sender { - using upstream_t = std::remove_cvref_t; using sender_concept = ::beman::execution::sender_tag; + using upstream_t = std::remove_cvref_t; upstream_t upstream; template @@ -48,22 +48,25 @@ inline constexpr struct into_optional_t : beman::execution::sender_adaptor_closu } template - static auto get_type(Env&&) { + static consteval auto get_type() { return find_type( ::beman::execution::value_types_of_t, type_list, type_list>()); } - template - constexpr auto make_signatures(auto&& env, type_list, type_list) const { + template + static consteval auto make_signatures(type_list, type_list) { return ::beman::execution::completion_signatures<::beman::execution::set_value_t( - decltype(this->get_type(env))), + decltype(get_type())), ::beman::execution::set_error_t(E)..., S...>(); } - template - auto get_completion_signatures(Env&& env) const { - return make_signatures( - env, + template + static consteval auto get_completion_signatures() { + static_assert(::beman::execution::sender); + static_assert(::beman::execution::sender_in); + static_assert(::beman::execution::sender_in); + return make_signatures( + ::beman::execution::value_types_of_t, type_list>{}, ::beman::execution::error_types_of_t, type_list>{}, std::conditional_t<::beman::execution::sends_stopped>, type_list<::beman::execution::set_stopped_t()>, @@ -73,7 +76,7 @@ inline constexpr struct into_optional_t : beman::execution::sender_adaptor_closu struct make_object { template auto operator()(A&&... a) const - -> decltype(get_type(::beman::execution::get_env(std::declval()))) { + -> decltype(get_type()))>()) { if constexpr (sizeof...(A) == 0u) return {}; else From 3e0b9bfc1d46ed69f89439fc503170f5e4734368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 19 Jul 2026 16:10:42 +0100 Subject: [PATCH 4/4] clang-format --- examples/cppnow_query.cpp | 2 +- examples/into_optional.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/cppnow_query.cpp b/examples/cppnow_query.cpp index a408906..757fae4 100644 --- a/examples/cppnow_query.cpp +++ b/examples/cppnow_query.cpp @@ -5,7 +5,7 @@ #include #include -namespace ex = beman::execution; +namespace ex = beman::execution; // ---------------------------------------------------------------------------- diff --git a/examples/into_optional.cpp b/examples/into_optional.cpp index 0986a85..03e186a 100644 --- a/examples/into_optional.cpp +++ b/examples/into_optional.cpp @@ -73,7 +73,9 @@ auto my_into_optional(S&& s) { int main() { queue que; ex::sync_wait([](auto& q) -> ex::task<> { - static_assert(std::same_as())>); + static_assert( + std::same_as())>); // auto x = co_await (ex::just(true) | ex::into_optional); // [[maybe_unused]] std::optional x = co_await (q.async_pop() | ex::into_optional); // [[maybe_unused]] std::optional y = co_await ex::into_optional(q.async_pop());