From 7fa2d6147efe989da2858ed81f3f5dd8a248f772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dietmar=20K=C3=BChl?= Date: Sun, 15 Sep 2024 08:14:27 +0100 Subject: [PATCH 1/2] added an into_expected algorithm --- CMakeLists.txt | 2 +- examples/CMakeLists.txt | 2 +- examples/demo_algorithm.hpp | 54 +++++++++++++++++++++++++++++++++++++ examples/http-server.cpp | 28 +++++++++---------- 4 files changed, 69 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd507d9..457b51b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ FetchContent_Declare( execution26 # for local development, use SOURCE_DIR /execution26 GIT_REPOSITORY https://github.com/beman-project/execution26 - GIT_TAG 5ad85cb + GIT_TAG 22affb6 ) FetchContent_MakeAvailable(execution26) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 486ffc9..e1c151f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -13,9 +13,9 @@ set(LIBRARIES include(GNUInstallDirs) set(EXAMPLES + http-server empty server - http-server client task ) diff --git a/examples/demo_algorithm.hpp b/examples/demo_algorithm.hpp index cb8272c..b698970 100644 --- a/examples/demo_algorithm.hpp +++ b/examples/demo_algorithm.hpp @@ -11,6 +11,11 @@ #include #include #include +#include +#if 202202L <= __cpp_lib_expected +# include +#endif + #include //-dk:TODO remove // ---------------------------------------------------------------------------- @@ -70,6 +75,13 @@ namespace demo::detail template using decayed_set_value_t = typename decayed_set_value::type; + template + struct decayed_tuple_or_single { using type = ::std::tuple<::std::decay_t...>; }; + template + struct decayed_tuple_or_single { using type = ::std::decay_t; }; + template + using decayed_tuple_or_single_t = typename decayed_tuple_or_single::type; + template struct make_type_list; template