diff --git a/examples/benchmark/static_thread_pool_bulk_enqueue.cpp b/examples/benchmark/static_thread_pool_bulk_enqueue.cpp index 297cd7e7d..022df1103 100644 --- a/examples/benchmark/static_thread_pool_bulk_enqueue.cpp +++ b/examples/benchmark/static_thread_pool_bulk_enqueue.cpp @@ -17,7 +17,7 @@ #include "./common.hpp" #include -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() # include # include diff --git a/examples/benchmark/static_thread_pool_bulk_enqueue_nested.cpp b/examples/benchmark/static_thread_pool_bulk_enqueue_nested.cpp index b6927f816..1ad5be451 100644 --- a/examples/benchmark/static_thread_pool_bulk_enqueue_nested.cpp +++ b/examples/benchmark/static_thread_pool_bulk_enqueue_nested.cpp @@ -17,7 +17,7 @@ #include "./common.hpp" #include -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() # include # include diff --git a/examples/hello_coro.cpp b/examples/hello_coro.cpp index 2ece71037..457695308 100644 --- a/examples/hello_coro.cpp +++ b/examples/hello_coro.cpp @@ -18,7 +18,7 @@ // Pull in the reference implementation of P2300: #include -#if !STDEXEC_NO_STD_COROUTINES() && !STDEXEC_NVHPC() +#if !STDEXEC_NO_STDCPP_COROUTINES() && !STDEXEC_NVHPC() # include using namespace stdexec; diff --git a/examples/nvexec/maxwell/stdpar.cuh b/examples/nvexec/maxwell/stdpar.cuh index 56ee6cd7e..6ccbc6b3b 100644 --- a/examples/nvexec/maxwell/stdpar.cuh +++ b/examples/nvexec/maxwell/stdpar.cuh @@ -20,7 +20,7 @@ #include "common.cuh" // IWYU pragma: keep -#if STDEXEC_HAS_PARALLEL_ALGORITHMS() +#if !STDEXEC_NO_STDCPP_PARALLEL_ALGORITHMS() # if STDEXEC_CUDA_COMPILATION() # include "../include/nvexec/detail/throw_on_cuda_error.cuh" @@ -81,4 +81,4 @@ void run_stdpar(float dt, }); } -#endif +#endif // !STDEXEC_NO_STDCPP_PARALLEL_ALGORITHMS() diff --git a/examples/nvexec/maxwell_cpu_mt.cu b/examples/nvexec/maxwell_cpu_mt.cu index 0917bb492..0ba9ede0c 100644 --- a/examples/nvexec/maxwell_cpu_mt.cu +++ b/examples/nvexec/maxwell_cpu_mt.cu @@ -35,7 +35,7 @@ auto main(int argc, char *argv[]) -> int << "\t--write-vtk\n" << "\t--iterations\n" << "\t--run-std\n" - << (STDEXEC_HAS_PARALLEL_ALGORITHMS() ? "\t--run-stdpar\n" : "") + << (STDEXEC_NO_STDCPP_PARALLEL_ALGORITHMS() ? "" : "\t--run-stdpar\n") << "\t--run-thread-pool-scheduler\n" << "\t--N\n" << std::endl; @@ -79,7 +79,7 @@ auto main(int argc, char *argv[]) -> int run_std(dt, write_vtk, n_iterations, grid, "CPU (std)"); } -# if STDEXEC_HAS_PARALLEL_ALGORITHMS() +# if !STDEXEC_NO_STDCPP_PARALLEL_ALGORITHMS() if (value(params, "run-stdpar")) { bool const gpu = is_gpu_policy(stdexec::par_unseq); diff --git a/examples/nvexec/maxwell_gpu_s.cu b/examples/nvexec/maxwell_gpu_s.cu index 11fc01bf0..945d04db7 100644 --- a/examples/nvexec/maxwell_gpu_s.cu +++ b/examples/nvexec/maxwell_gpu_s.cu @@ -30,7 +30,7 @@ auto main(int argc, char *argv[]) -> int std::cout << "Usage: " << argv[0] << " [OPTION]...\n" << "\t--write-vtk\n" << "\t--iterations\n" - << (STDEXEC_HAS_PARALLEL_ALGORITHMS() ? "\t--run-stdpar\n" : "") // + << (STDEXEC_NO_STDCPP_PARALLEL_ALGORITHMS() ? "" : "\t--run-stdpar\n") // << "\t--run-cuda\n" << "\t--run-stream-scheduler\n" << "\t--N\n" @@ -75,7 +75,7 @@ auto main(int argc, char *argv[]) -> int run_snr_on("GPU (snr cuda stream)", stream_ctx.get_scheduler()); } -# if STDEXEC_HAS_PARALLEL_ALGORITHMS() +# if !STDEXEC_NO_STDCPP_PARALLEL_ALGORITHMS() if (value(params, "run-stdpar")) { bool const gpu = is_gpu_policy(stdexec::par_unseq); @@ -87,7 +87,7 @@ auto main(int argc, char *argv[]) -> int run_stdpar(dt, write_vtk, n_iterations, grid, stdexec::par_unseq, method); } -# endif // STDEXEC_HAS_PARALLEL_ALGORITHMS() +# endif // !STDEXEC_NO_STDCPP_PARALLEL_ALGORITHMS() } #endif // !defined(STDEXEC_CLANGD_INVOKED) diff --git a/examples/server_theme/let_value.cpp b/examples/server_theme/let_value.cpp index 987c601fd..e5540872b 100644 --- a/examples/server_theme/let_value.cpp +++ b/examples/server_theme/let_value.cpp @@ -52,7 +52,7 @@ #include "exec/start_detached.hpp" #include "exec/static_thread_pool.hpp" -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() namespace ex = stdexec; struct http_request @@ -177,4 +177,4 @@ int main() std::cout << "This example requires C++ exceptions to be enabled.\n"; return 0; } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() diff --git a/include/exec/detail/bit_cast.hpp b/include/exec/detail/bit_cast.hpp index bc41b113f..b3de91d3f 100644 --- a/include/exec/detail/bit_cast.hpp +++ b/include/exec/detail/bit_cast.hpp @@ -21,7 +21,9 @@ #if __has_include() # include # if __cpp_lib_bit_cast >= 2018'06L -# define STDEXEC_HAS_BIT_CAST +# define STDEXEC_NO_STDCPP_BIT_CAST() 0 +# else +# define STDEXEC_NO_STDCPP_BIT_CAST() 1 # endif #endif @@ -29,11 +31,10 @@ namespace experimental::execution { - template concept __trivially_copyable = STDEXEC_IS_TRIVIALLY_COPYABLE(_Ty); -#if defined(STDEXEC_HAS_BIT_CAST) +#if !STDEXEC_NO_STDCPP_BIT_CAST() using std::bit_cast; #else template <__trivially_copyable _To, __trivially_copyable _From> diff --git a/include/exec/sequence/iterate.hpp b/include/exec/sequence/iterate.hpp index e5a3ff03b..d784557b1 100644 --- a/include/exec/sequence/iterate.hpp +++ b/include/exec/sequence/iterate.hpp @@ -18,7 +18,7 @@ #include "../../stdexec/__detail/__config.hpp" -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() # include "../../stdexec/__detail/__optional.hpp" # include "../../stdexec/execution.hpp" @@ -241,4 +241,4 @@ namespace experimental::execution namespace exec = experimental::execution; -#endif // STDEXEC_HAS_STD_RANGES() +#endif // !STDEXEC_NO_STDCPP_RANGES() diff --git a/include/exec/sequence_senders.hpp b/include/exec/sequence_senders.hpp index 151d3ba13..11cee28b0 100644 --- a/include/exec/sequence_senders.hpp +++ b/include/exec/sequence_senders.hpp @@ -245,7 +245,7 @@ namespace experimental::execution struct _FAILED_TO_COMPUTE_SEQUENCE_ITEM_TYPES_ {}; -#if STDEXEC_NO_STD_CONSTEXPR_EXCEPTIONS() +#if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() template [[nodiscard]] diff --git a/include/exec/static_thread_pool.hpp b/include/exec/static_thread_pool.hpp index e76befad6..23c3f45fc 100644 --- a/include/exec/static_thread_pool.hpp +++ b/include/exec/static_thread_pool.hpp @@ -89,7 +89,7 @@ namespace experimental::execution return std::make_pair(static_cast(begin), static_cast(end)); } -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() namespace schedule_all_ { template @@ -252,7 +252,7 @@ namespace experimental::execution _static_thread_pool& pool_; }; -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() struct _transform_iterate { template @@ -300,7 +300,7 @@ namespace experimental::execution } } -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() template Sender, class Env> constexpr auto transform_sender(STDEXEC::set_value_t, Sender&& sndr, const Env& env) const noexcept @@ -1564,7 +1564,7 @@ namespace experimental::execution {} }; -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() namespace schedule_all_ { template @@ -1823,7 +1823,7 @@ namespace experimental::execution struct static_thread_pool : private _pool_::_static_thread_pool { -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() friend struct _pool_::schedule_all_t; #endif using task_base = _pool_::task_base; @@ -1858,7 +1858,7 @@ namespace experimental::execution using _pool_::_static_thread_pool::params; }; -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() namespace _pool_ { struct schedule_all_t diff --git a/include/stdexec/__detail/__as_awaitable.hpp b/include/stdexec/__detail/__as_awaitable.hpp index 0450628cf..956ba8017 100644 --- a/include/stdexec/__detail/__as_awaitable.hpp +++ b/include/stdexec/__detail/__as_awaitable.hpp @@ -31,7 +31,7 @@ namespace STDEXEC { -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() namespace __detail { template diff --git a/include/stdexec/__detail/__awaitable.hpp b/include/stdexec/__detail/__awaitable.hpp index 5542cd685..137fba99f 100644 --- a/include/stdexec/__detail/__awaitable.hpp +++ b/include/stdexec/__detail/__awaitable.hpp @@ -21,7 +21,7 @@ namespace STDEXEC { -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() // Define some concepts and utilities for working with awaitables template concept __await_suspend_result = __one_of<_Tp, void, bool> diff --git a/include/stdexec/__detail/__completion_signatures.hpp b/include/stdexec/__detail/__completion_signatures.hpp index 507e1c5f7..221964bbd 100644 --- a/include/stdexec/__detail/__completion_signatures.hpp +++ b/include/stdexec/__detail/__completion_signatures.hpp @@ -77,7 +77,7 @@ namespace STDEXEC using __completion_signature_ptrs_t = decltype(__cmplsigs::__repack_completions( static_cast<_SigPtrs>(nullptr)...)); -#if STDEXEC_NO_STD_CONSTEXPR_EXCEPTIONS() +#if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() template [[nodiscard]] @@ -561,7 +561,7 @@ namespace STDEXEC // } // else -#if STDEXEC_NO_STD_CONSTEXPR_EXCEPTIONS() +#if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() # define STDEXEC_COMPLSIGS_LET(_ID, ...) \ if constexpr ([[maybe_unused]] \ diff --git a/include/stdexec/__detail/__concepts.hpp b/include/stdexec/__detail/__concepts.hpp index f55063818..8260ae23a 100644 --- a/include/stdexec/__detail/__concepts.hpp +++ b/include/stdexec/__detail/__concepts.hpp @@ -25,14 +25,7 @@ #include // IWYU pragma: keep for std::swap #include -// Perhaps the stdlib lacks support for concepts though: -#if __has_include() && __cpp_lib_concepts >= 2020'02L -# define STDEXEC_HAS_STD_CONCEPTS_HEADER() 1 -#else -# define STDEXEC_HAS_STD_CONCEPTS_HEADER() 0 -#endif - -#if STDEXEC_HAS_STD_CONCEPTS_HEADER() +#if !STDEXEC_NO_STDCPP_CONCEPTS_HEADER() # include #else # include @@ -112,7 +105,7 @@ namespace STDEXEC template concept same_as = __same_as<_Ap, _Bp> && __same_as<_Bp, _Ap>; -#if STDEXEC_HAS_STD_CONCEPTS_HEADER() +#if !STDEXEC_NO_STDCPP_CONCEPTS_HEADER() using std::integral; using std::derived_from; diff --git a/include/stdexec/__detail/__config.hpp b/include/stdexec/__detail/__config.hpp index 10be7bb89..001a0861a 100644 --- a/include/stdexec/__detail/__config.hpp +++ b/include/stdexec/__detail/__config.hpp @@ -224,23 +224,23 @@ STDEXEC_NAMESPACE_STD_END //////////////////////////////////////////////////////////////////////////////////////////////////// #if __cpp_impl_coroutine >= 2019'02L && __cpp_lib_coroutine >= 2019'02L # include // IWYU pragma: keep -# define STDEXEC_NO_STD_COROUTINES() 0 +# define STDEXEC_NO_STDCPP_COROUTINES() 0 namespace STDEXEC::__std { namespace __coro = std; // NOLINT(misc-unused-alias-decls) } // namespace STDEXEC::__std #elif defined(__cpp_coroutines) && __has_include() # include -# define STDEXEC_NO_STD_COROUTINES() 0 +# define STDEXEC_NO_STDCPP_COROUTINES() 0 namespace STDEXEC::__std { namespace __coro = std::experimental; // NOLINT(misc-unused-alias-decls) } // namespace STDEXEC::__std #else -# define STDEXEC_NO_STD_COROUTINES() 1 +# define STDEXEC_NO_STDCPP_COROUTINES() 1 #endif -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() namespace STDEXEC::__std { using __coro::coroutine_handle; @@ -551,9 +551,9 @@ namespace STDEXEC // https://github.com/llvm/llvm-project/issues/116105 #if defined(__cpp_pack_indexing) && !STDEXEC_NVCC() \ && !(STDEXEC_CLANG() && STDEXEC_CLANG_VERSION < 20'00) -# define STDEXEC_NO_STD_PACK_INDEXING() 0 +# define STDEXEC_NO_STDCPP_PACK_INDEXING() 0 #else // ^^^ has pack indexing ^^^ / vvv no pack indexing vvv -# define STDEXEC_NO_STD_PACK_INDEXING() 1 +# define STDEXEC_NO_STDCPP_PACK_INDEXING() 1 #endif // no pack indexing #if STDEXEC_HAS_FEATURE(thread_sanitizer) || defined(__SANITIZE_THREAD__) @@ -566,34 +566,47 @@ namespace STDEXEC #if __has_include() && \ (defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 2019'11L) && \ (!STDEXEC_CLANG() || STDEXEC_CLANG_VERSION >= 16'00 || defined(_LIBCPP_VERSION)) -# define STDEXEC_HAS_STD_RANGES() 1 +# define STDEXEC_NO_STDCPP_RANGES() 0 #else -# define STDEXEC_HAS_STD_RANGES() 0 +# define STDEXEC_NO_STDCPP_RANGES() 1 #endif #if __has_include() && \ (defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 2016'03L) -# define STDEXEC_HAS_STD_MEMORY_RESOURCE() 1 +# define STDEXEC_NO_STDCPP_MEMORY_RESOURCE() 0 #else -# define STDEXEC_HAS_STD_MEMORY_RESOURCE() 0 +# define STDEXEC_NO_STDCPP_MEMORY_RESOURCE() 1 #endif #if defined(__cpp_lib_execution) && __cpp_lib_execution >= 2016'03L -# define STDEXEC_HAS_EXECUTION_POLICY() 1 +# define STDEXEC_NO_STDCPP_EXECUTION_POLICY() 0 #else -# define STDEXEC_HAS_EXECUTION_POLICY() 0 +# define STDEXEC_NO_STDCPP_EXECUTION_POLICY() 1 #endif #if defined(__cpp_lib_execution) && __cpp_lib_execution >= 2019'02L -# define STDEXEC_HAS_UNSEQUENCED_EXECUTION_POLICY() 1 +# define STDEXEC_NO_STDCPP_UNSEQUENCED_EXECUTION_POLICY() 0 #else -# define STDEXEC_HAS_UNSEQUENCED_EXECUTION_POLICY() 0 +# define STDEXEC_NO_STDCPP_UNSEQUENCED_EXECUTION_POLICY() 1 #endif #if defined(__cpp_lib_parallel_algorithm) && __cpp_lib_parallel_algorithm >= 2016'03L -# define STDEXEC_HAS_PARALLEL_ALGORITHMS() 1 +# define STDEXEC_NO_STDCPP_PARALLEL_ALGORITHMS() 0 #else -# define STDEXEC_HAS_PARALLEL_ALGORITHMS() 0 +# define STDEXEC_NO_STDCPP_PARALLEL_ALGORITHMS() 1 +#endif + +#if defined(__cpp_explicit_this_parameter) && (__cpp_explicit_this_parameter >= 2021'10L) +# define STDEXEC_NO_STDCPP_EXPLICIT_THIS_PARAMETER() 0 +#else +# define STDEXEC_NO_STDCPP_EXPLICIT_THIS_PARAMETER() 1 +#endif + +// Perhaps the stdlib lacks support for concepts +#if __has_include() && __cpp_lib_concepts >= 2020'02L +# define STDEXEC_NO_STDCPP_CONCEPTS_HEADER() 0 +#else +# define STDEXEC_NO_STDCPP_CONCEPTS_HEADER() 1 #endif #if defined(__cpp_if_consteval) && __cpp_if_consteval >= 2021'06L @@ -632,12 +645,6 @@ namespace STDEXEC # define STDEXEC_FRIENDSHIP_IS_LEXICAL() 0 #endif -#if defined(__cpp_explicit_this_parameter) && (__cpp_explicit_this_parameter >= 2021'10L) -# define STDEXEC_HAS_STD_EXPLICIT_THIS() 1 -#else -# define STDEXEC_HAS_STD_EXPLICIT_THIS() 0 -#endif - #if STDEXEC_ENABLE_EXTRA_TYPE_CHECKING == 0 # undef STDEXEC_ENABLE_EXTRA_TYPE_CHECKING # define STDEXEC_ENABLE_EXTRA_TYPE_CHECKING() 0 @@ -647,22 +654,22 @@ namespace STDEXEC #endif #if STDEXEC_CUDA_COMPILATION() && defined(__CUDA_ARCH__) -# define STDEXEC_NO_STD_EXCEPTIONS() 1 +# define STDEXEC_NO_STDCPP_EXCEPTIONS() 1 #elif STDEXEC_MSVC() || STDEXEC_CLANG_CL() -# define STDEXEC_NO_STD_EXCEPTIONS() (_HAS_EXCEPTIONS == 0) || (_CPPUNWIND == 0) +# define STDEXEC_NO_STDCPP_EXCEPTIONS() (_HAS_EXCEPTIONS == 0) || (_CPPUNWIND == 0) #else -# define STDEXEC_NO_STD_EXCEPTIONS() (__EXCEPTIONS == 0) +# define STDEXEC_NO_STDCPP_EXCEPTIONS() (__EXCEPTIONS == 0) #endif #if defined(__cpp_constexpr_exceptions) && __cpp_constexpr_exceptions >= 2024'11L -# if !STDEXEC_NO_STD_EXCEPTIONS() +# if !STDEXEC_NO_STDCPP_EXCEPTIONS() // https://wg21.link/p3068 -# define STDEXEC_NO_STD_CONSTEXPR_EXCEPTIONS() 0 +# define STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() 0 # else -# define STDEXEC_NO_STD_CONSTEXPR_EXCEPTIONS() 1 +# define STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() 1 # endif #else -# define STDEXEC_NO_STD_CONSTEXPR_EXCEPTIONS() 1 +# define STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() 1 #endif // We need to treat host and device separately @@ -715,7 +722,7 @@ namespace STDEXEC // { // printf("unknown error\n"); // } -#if STDEXEC_NO_STD_EXCEPTIONS() +#if STDEXEC_NO_STDCPP_EXCEPTIONS() # define STDEXEC_TRY if constexpr (true) { # define STDEXEC_CATCH(...) } else if constexpr (__VA_ARGS__ = ::STDEXEC::__catch_any_lvalue; false) { # define STDEXEC_CATCH_ALL } else if constexpr (true) {} else @@ -762,40 +769,44 @@ namespace STDEXEC /// STDEXEC_EXPLICIT_THIS_END(connect) /// @endcode -#if STDEXEC_HAS_STD_EXPLICIT_THIS() +#if !STDEXEC_NO_STDCPP_EXPLICIT_THIS_PARAMETER() # define STDEXEC_EXPLICIT_THIS_BEGIN(...) __VA_ARGS__ # define STDEXEC_EXPLICIT_THIS_END(...) #else -# define STDEXEC_EXPLICIT_THIS_BEGIN(...) \ - static STDEXEC_PP_EXPAND(STDEXEC_PP_CAT(STDEXEC_EXPLICIT_THIS_MANGLE_, __VA_ARGS__) \ +# define STDEXEC_EXPLICIT_THIS_BEGIN(...) \ + static STDEXEC_PP_EXPAND(STDEXEC_PP_CAT(STDEXEC_EXPLICIT_THIS_MANGLE_, __VA_ARGS__) \ STDEXEC_PP_RPAREN) STDEXEC_PP_LPAREN STDEXEC_EXPLICIT_THIS_ARGS -# define STDEXEC_EXPLICIT_THIS_ARGS(...) \ +# define STDEXEC_EXPLICIT_THIS_ARGS(...) \ STDEXEC_PP_CAT(STDEXEC_EXPLICIT_THIS_EAT_, __VA_ARGS__) STDEXEC_PP_RPAREN -# define STDEXEC_EXPLICIT_THIS_END(_FN) \ - template \ - STDEXEC_ATTRIBUTE(always_inline) \ - auto _FN(_Ts&&... __args) \ - && STDEXEC_AUTO_RETURN( \ - decltype(STDEXEC::__get_self<_Ts...>(*this))::STDEXEC_PP_CAT(static_, _FN)( \ - std::move(*this), static_cast<_Ts&&>(__args)...)) \ - \ - template \ - STDEXEC_ATTRIBUTE(always_inline) \ - auto _FN(_Ts&&... __args) \ - & STDEXEC_AUTO_RETURN( \ - decltype(STDEXEC::__get_self<_Ts...>( \ - *this))::STDEXEC_PP_CAT(static_, _FN)(*this, static_cast<_Ts&&>(__args)...)) \ - \ - template \ - STDEXEC_ATTRIBUTE(always_inline) \ - auto _FN(_Ts&&... __args) const & STDEXEC_AUTO_RETURN( \ - decltype(STDEXEC::__get_self<_Ts...>( \ - *this))::STDEXEC_PP_CAT(static_, _FN)(*this, static_cast<_Ts&&>(__args)...)) +# define STDEXEC_EXPLICIT_THIS_END(_FN) \ + template \ + STDEXEC_ATTRIBUTE(always_inline) \ + auto _FN(_Ts&&... __args) && STDEXEC_AUTO_RETURN \ + ( \ + decltype(STDEXEC::__get_self<_Ts...>(*this)) \ + ::STDEXEC_PP_CAT(static_, _FN)(std::move(*this), static_cast<_Ts&&>(__args)...) \ + ) \ + \ + template \ + STDEXEC_ATTRIBUTE(always_inline) \ + auto _FN(_Ts&&... __args) & STDEXEC_AUTO_RETURN \ + ( \ + decltype(STDEXEC::__get_self<_Ts...>(*this)) \ + ::STDEXEC_PP_CAT(static_, _FN)(*this, static_cast<_Ts&&>(__args)...) \ + ) \ + \ + template \ + STDEXEC_ATTRIBUTE(always_inline) \ + auto _FN(_Ts&&... __args) const & STDEXEC_AUTO_RETURN \ + ( \ + decltype(STDEXEC::__get_self<_Ts...>(*this)) \ + ::STDEXEC_PP_CAT(static_, _FN)(*this, static_cast<_Ts&&>(__args)...) \ + ) # define STDEXEC_EXPLICIT_THIS_EAT_this # define STDEXEC_EXPLICIT_THIS_EAT_auto @@ -810,7 +821,7 @@ namespace STDEXEC constexpr auto __get_self(_Self const &) -> _Self; } // namespace STDEXEC -#endif // !STDEXEC_HAS_STD_EXPLICIT_THIS() +#endif // STDEXEC_NO_STDCPP_EXPLICIT_THIS_PARAMETER() //////////////////////////////////////////////////////////////////////////////////////////////////// #if STDEXEC_CLANG() && STDEXEC_CUDA_COMPILATION() && !defined(STDEXEC_CLANG_TIDY_INVOKED) diff --git a/include/stdexec/__detail/__connect_awaitable.hpp b/include/stdexec/__detail/__connect_awaitable.hpp index 8c7f37907..3843a5891 100644 --- a/include/stdexec/__detail/__connect_awaitable.hpp +++ b/include/stdexec/__detail/__connect_awaitable.hpp @@ -32,7 +32,7 @@ STDEXEC_PRAGMA_IGNORE_GNU("-Wsubobject-linkage") namespace STDEXEC { -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() ///////////////////////////////////////////////////////////////////////////// // __connect_await namespace __connect_await diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index e1f3d19b0..9b18854b1 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -170,7 +170,7 @@ namespace STDEXEC using __cmplsigs::get_completion_signatures_t; -#if STDEXEC_NO_STD_CONSTEXPR_EXCEPTIONS() +#if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() template consteval auto __throw_compile_time_error(_Values...) -> __mexception<_What...>; diff --git a/include/stdexec/__detail/__execution_legacy.hpp b/include/stdexec/__detail/__execution_legacy.hpp index c788badac..5305fd8f0 100644 --- a/include/stdexec/__detail/__execution_legacy.hpp +++ b/include/stdexec/__detail/__execution_legacy.hpp @@ -17,14 +17,14 @@ #include "__config.hpp" -#if STDEXEC_HAS_EXECUTION_POLICY() +#if !STDEXEC_NO_STDCPP_EXECUTION_POLICY() # include #endif namespace STDEXEC { -#if STDEXEC_HAS_EXECUTION_POLICY() +#if !STDEXEC_NO_STDCPP_EXECUTION_POLICY() // Import the execution policies from std::execution. The __policy namespace is used to // avoid name clashes if the macro STDEXEC expands to std::execution. @@ -75,7 +75,7 @@ namespace STDEXEC #endif -#if STDEXEC_HAS_UNSEQUENCED_EXECUTION_POLICY() +#if !STDEXEC_NO_STDCPP_UNSEQUENCED_EXECUTION_POLICY() namespace __policy { diff --git a/include/stdexec/__detail/__get_completion_signatures.hpp b/include/stdexec/__detail/__get_completion_signatures.hpp index 4f4d9b8a5..018451614 100644 --- a/include/stdexec/__detail/__get_completion_signatures.hpp +++ b/include/stdexec/__detail/__get_completion_signatures.hpp @@ -317,7 +317,7 @@ namespace STDEXEC __fwd_env_t<_Env>...>(); } -#if STDEXEC_NO_STD_CONSTEXPR_EXCEPTIONS() +#if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() template concept __is_dependent_sender = __std::derived_from<__completion_signatures_of_t<_Sender>, dependent_sender_error>; diff --git a/include/stdexec/__detail/__meta.hpp b/include/stdexec/__detail/__meta.hpp index 371a51973..9fc4a42a8 100644 --- a/include/stdexec/__detail/__meta.hpp +++ b/include/stdexec/__detail/__meta.hpp @@ -957,7 +957,7 @@ namespace STDEXEC using __f = __minvoke_q<__mor, __mcall1<_Fn, _Args>...>; }; -#if !STDEXEC_NO_STD_PACK_INDEXING() +#if !STDEXEC_NO_STDCPP_PACK_INDEXING() STDEXEC_PRAGMA_PUSH() STDEXEC_PRAGMA_IGNORE_GNU("-Wc++26-extensions") diff --git a/include/stdexec/__detail/__ranges.hpp b/include/stdexec/__detail/__ranges.hpp index 2c21b6058..43453e8c8 100644 --- a/include/stdexec/__detail/__ranges.hpp +++ b/include/stdexec/__detail/__ranges.hpp @@ -18,7 +18,7 @@ #include "__config.hpp" #include "__type_traits.hpp" -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() # include diff --git a/include/stdexec/__detail/__task.hpp b/include/stdexec/__detail/__task.hpp index 138bdf7e7..26ab194ec 100644 --- a/include/stdexec/__detail/__task.hpp +++ b/include/stdexec/__detail/__task.hpp @@ -35,7 +35,7 @@ STDEXEC_PRAGMA_IGNORE_GNU("-Wmismatched-new-delete") namespace STDEXEC { -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() namespace __task { //////////////////////////////////////////////////////////////////////////////// @@ -596,7 +596,7 @@ namespace STDEXEC __variant __stop_{__no_init}; __opstate_base* __state_ = nullptr; }; -#endif // !STDEXEC_NO_STD_COROUTINES() +#endif // !STDEXEC_NO_STDCPP_COROUTINES() } // namespace STDEXEC STDEXEC_PRAGMA_POP() diff --git a/include/stdexec/__detail/__transform_completion_signatures.hpp b/include/stdexec/__detail/__transform_completion_signatures.hpp index 480c94fe9..002741dcf 100644 --- a/include/stdexec/__detail/__transform_completion_signatures.hpp +++ b/include/stdexec/__detail/__transform_completion_signatures.hpp @@ -32,7 +32,7 @@ namespace STDEXEC { namespace __cmplsigs { -#if STDEXEC_NO_STD_CONSTEXPR_EXCEPTIONS() +#if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS() // Without constexpr exceptions, we cannot always produce a valid // completion_signatures type. We must permit get_completion_signatures to return an // error type because we can't throw it. diff --git a/include/stdexec/__detail/__with_awaitable_senders.hpp b/include/stdexec/__detail/__with_awaitable_senders.hpp index a83109e14..a8b580fdf 100644 --- a/include/stdexec/__detail/__with_awaitable_senders.hpp +++ b/include/stdexec/__detail/__with_awaitable_senders.hpp @@ -25,7 +25,7 @@ namespace STDEXEC { -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() template class __coroutine_handle; diff --git a/test/exec/async_scope/test_spawn.cpp b/test/exec/async_scope/test_spawn.cpp index 3522d0ca0..5489b81ec 100644 --- a/test/exec/async_scope/test_spawn.cpp +++ b/test/exec/async_scope/test_spawn.cpp @@ -60,7 +60,7 @@ namespace REQUIRE(executed); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("spawn will propagate exceptions encountered during op creation", "[async_scope][spawn]") { @@ -79,7 +79,7 @@ namespace FAIL("invalid exception caught"); } } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("TODO: spawn will keep the scope non-empty until the work is executed", "[async_scope][spawn]") diff --git a/test/exec/async_scope/test_spawn_future.cpp b/test/exec/async_scope/test_spawn_future.cpp index 2f6137700..001f924aa 100644 --- a/test/exec/async_scope/test_spawn_future.cpp +++ b/test/exec/async_scope/test_spawn_future.cpp @@ -30,7 +30,7 @@ namespace loop.run(); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() //! Sender that throws exception when connected struct throwing_sender { @@ -54,7 +54,7 @@ namespace throw std::logic_error("cannot connect"); } }; -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("spawn_future will execute its work", "[async_scope][spawn_future]") { @@ -151,7 +151,7 @@ namespace expect_empty(scope); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("spawn_future with throwing copy", "[async_scope][spawn_future]") { async_scope scope; @@ -185,7 +185,7 @@ namespace } sync_wait(scope.on_empty()); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("spawn_future returned sender can be connected but not started", "[async_scope][spawn_future]") @@ -244,7 +244,7 @@ namespace expect_empty(scope); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("spawn_future will propagate exceptions encountered during op creation", "[async_scope][spawn_future]") { @@ -266,7 +266,7 @@ namespace } expect_empty(scope); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("TODO: spawn_future will keep the scope non-empty until the work is executed", "[async_scope][spawn_future]") diff --git a/test/exec/sequence/test_ignore_all_values.cpp b/test/exec/sequence/test_ignore_all_values.cpp index e5241de12..110d7753a 100644 --- a/test/exec/sequence/test_ignore_all_values.cpp +++ b/test/exec/sequence/test_ignore_all_values.cpp @@ -65,7 +65,7 @@ namespace CHECK_FALSE(STDEXEC::sync_wait(sndr)); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("ignore_all_values - ignore just_error()", "[sequence_senders][ignore_all_values]") { auto sndr = exec::ignore_all_values( @@ -78,7 +78,7 @@ namespace STDEXEC::completion_signatures_of_t>>); CHECK_THROWS(STDEXEC::sync_wait(sndr)); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() struct sequence_op { diff --git a/test/exec/sequence/test_iterate.cpp b/test/exec/sequence/test_iterate.cpp index b879df806..d3efc6f42 100644 --- a/test/exec/sequence/test_iterate.cpp +++ b/test/exec/sequence/test_iterate.cpp @@ -18,7 +18,7 @@ #include "exec/sequence/iterate.hpp" #include "stdexec/execution.hpp" -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() # include # include @@ -144,4 +144,4 @@ namespace } // namespace -#endif // STDEXEC_HAS_STD_RANGES() +#endif // !STDEXEC_NO_STDCPP_RANGES() diff --git a/test/exec/sequence/test_merge.cpp b/test/exec/sequence/test_merge.cpp index 6ac789bda..6259867b1 100644 --- a/test/exec/sequence/test_merge.cpp +++ b/test/exec/sequence/test_merge.cpp @@ -140,7 +140,7 @@ namespace CHECK(count == 2); } -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() TEST_CASE("merge - merge sender merges all items", "[sequence_senders][merge][iterate]") { auto range = [](auto from, auto to) diff --git a/test/exec/sequence/test_merge_each.cpp b/test/exec/sequence/test_merge_each.cpp index 709a8372e..eb741fc60 100644 --- a/test/exec/sequence/test_merge_each.cpp +++ b/test/exec/sequence/test_merge_each.cpp @@ -197,7 +197,7 @@ namespace }); }; -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() // a sequence of numbers from itoa() [[maybe_unused]] @@ -385,6 +385,6 @@ namespace } # endif // 0 -#endif // STDEXEC_HAS_STD_RANGES() +#endif // !STDEXEC_NO_STDCPP_RANGES() } // namespace diff --git a/test/exec/sequence/test_merge_each_threaded.cpp b/test/exec/sequence/test_merge_each_threaded.cpp index 75e42919d..be365bb6b 100644 --- a/test/exec/sequence/test_merge_each_threaded.cpp +++ b/test/exec/sequence/test_merge_each_threaded.cpp @@ -201,7 +201,7 @@ namespace }); }; -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() // a sequence of numbers from itoa() [[maybe_unused]] @@ -409,6 +409,6 @@ namespace CHECK(v.has_value() == false); } -#endif // STDEXEC_HAS_STD_RANGES() +#endif // !STDEXEC_NO_STDCPP_RANGES() } // namespace diff --git a/test/exec/sequence/test_transform_each.cpp b/test/exec/sequence/test_transform_each.cpp index 4cd082560..ca4a96439 100644 --- a/test/exec/sequence/test_transform_each.cpp +++ b/test/exec/sequence/test_transform_each.cpp @@ -74,7 +74,7 @@ namespace CHECK(value == 42); } -#if STDEXEC_HAS_STD_RANGES() +#if !STDEXEC_NO_STDCPP_RANGES() TEST_CASE("transform_each - transform sender applies adaptor to each item", "[sequence_senders][transform_each][iterate]") { diff --git a/test/exec/tbb/test_tbb_thread_pool.cpp b/test/exec/tbb/test_tbb_thread_pool.cpp index 7052e40e0..3918d7d55 100644 --- a/test/exec/tbb/test_tbb_thread_pool.cpp +++ b/test/exec/tbb/test_tbb_thread_pool.cpp @@ -132,7 +132,7 @@ namespace CHECK(k == 5); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("tbb_thread_pool exceptions", "[tbb_thread_pool]") { // I know tbb::task_groups do cancellation with exceptions, which leaves them in a not-restartable @@ -157,7 +157,7 @@ namespace CHECK(tbb_result == other_result); } } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("tbb_thread_pool async_inclusive_scan", "[tbb_thread_pool]") { diff --git a/test/exec/test_any_sender.cpp b/test/exec/test_any_sender.cpp index 298dada4c..ac647df47 100644 --- a/test/exec/test_any_sender.cpp +++ b/test/exec/test_any_sender.cpp @@ -152,7 +152,7 @@ namespace ref = error; ex::set_error(static_cast(ref), std::make_exception_ptr(42)); CHECK(error.value_.index() == 2); -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() // MSVC issues a warning about unreachable code in this block, hence the warning // suppression at the top of the file. CHECK_THROWS_AS(std::rethrow_exception(std::get<2>(error.value_)), int); @@ -314,7 +314,7 @@ namespace template using my_sender_of = any_sender_of; -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("ex::sync_wait returns value and exception", "[types][any_sender]") { my_sender_of sender = ex::just(21) | ex::then([&](int v) { return 2 * v; }); @@ -324,7 +324,7 @@ namespace sender = ex::just(21) | ex::then([&](int) -> int { throw 420; }); CHECK_THROWS_AS(ex::sync_wait(std::move(sender)), int); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("any_sender is connectable with exec::any_receiver_ref", "[types][any_sender]") { @@ -366,7 +366,7 @@ namespace ex::set_error_t(std::exception_ptr), ex::set_stopped_t()>; -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("any_sender uses overload rules for completion signatures", "[types][any_sender]") { auto split_sender = exec::split(ex::just(42)); @@ -381,7 +381,7 @@ namespace sender = ex::just(21) | ex::then([&](int) -> int { throw 420; }); CHECK_THROWS_AS(ex::sync_wait(std::move(sender)), int); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() class stopped_token { diff --git a/test/exec/test_at_coroutine_exit.cpp b/test/exec/test_at_coroutine_exit.cpp index 25e44141a..991230bda 100644 --- a/test/exec/test_at_coroutine_exit.cpp +++ b/test/exec/test_at_coroutine_exit.cpp @@ -17,7 +17,7 @@ #include -#if !STDEXEC_NO_STD_COROUTINES() && !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_COROUTINES() && !STDEXEC_NO_STDCPP_EXCEPTIONS() # include # include # include @@ -541,4 +541,4 @@ namespace } // unnamed namespace -#endif // !STDEXEC_NO_STD_COROUTINES() && !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_COROUTINES() && !STDEXEC_NO_STDCPP_EXCEPTIONS() diff --git a/test/exec/test_create.cpp b/test/exec/test_create.cpp index 16ce5da49..142b38a09 100644 --- a/test/exec/test_create.cpp +++ b/test/exec/test_create.cpp @@ -85,7 +85,7 @@ namespace }); }(1, 2); -#if STDEXEC_NO_STD_EXCEPTIONS() +#if STDEXEC_NO_STDCPP_EXCEPTIONS() auto [res] = STDEXEC::sync_wait(std::move(snd)).value(); CHECK(res == 3); #else diff --git a/test/exec/test_sequence.cpp b/test/exec/test_sequence.cpp index a20dc613a..9443a6cc4 100644 --- a/test/exec/test_sequence.cpp +++ b/test/exec/test_sequence.cpp @@ -150,7 +150,7 @@ TEST_CASE("sequence with two arguments works", "[sequence]") } } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("sequence with sender with throwing connect", "[sequence]") { auto err = std::make_exception_ptr(connect_exception{}); @@ -158,4 +158,4 @@ TEST_CASE("sequence with sender with throwing connect", "[sequence]") auto op = ex::connect(std::move(sndr), expect_error_receiver{err}); ex::start(op); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() diff --git a/test/exec/test_start_detached.cpp b/test/exec/test_start_detached.cpp index aee370b5a..3f535a935 100644 --- a/test/exec/test_start_detached.cpp +++ b/test/exec/test_start_detached.cpp @@ -25,7 +25,7 @@ #include // IWYU pragma: keep for std::chrono_literals -#if STDEXEC_HAS_STD_MEMORY_RESOURCE() +#if !STDEXEC_NO_STDCPP_MEMORY_RESOURCE() # include #endif @@ -219,7 +219,7 @@ namespace CHECK(called); } -#if STDEXEC_HAS_STD_MEMORY_RESOURCE() \ +#if !STDEXEC_NO_STDCPP_MEMORY_RESOURCE() \ && (defined(__cpp_lib_polymorphic_allocator) && __cpp_lib_polymorphic_allocator >= 2019'02L) struct counting_resource : std::pmr::memory_resource diff --git a/test/exec/test_task.cpp b/test/exec/test_task.cpp index ef6596970..6bd799109 100644 --- a/test/exec/test_task.cpp +++ b/test/exec/test_task.cpp @@ -17,7 +17,7 @@ #include -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() # include # include # include @@ -321,7 +321,7 @@ namespace CHECK(msg == "goodbye"s); } -# if !STDEXEC_NO_STD_EXCEPTIONS() +# if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("task - can error early", "[types][task]") { int count = 0; @@ -348,7 +348,7 @@ namespace } CHECK(count == 3); } -# endif // !STDEXEC_NO_STD_EXCEPTIONS() +# endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() } // namespace #endif diff --git a/test/exec/test_when_any.cpp b/test/exec/test_when_any.cpp index fd515d7fe..6dcb2d3ee 100644 --- a/test/exec/test_when_any.cpp +++ b/test/exec/test_when_any.cpp @@ -214,10 +214,10 @@ namespace } }; -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("when_any - with duplicate completions", "[adaptors][when_any]") { REQUIRE_THROWS(STDEXEC::sync_wait(exec::when_any(dup_sender{}))); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() } // namespace diff --git a/test/stdexec/algos/adaptors/test_bulk.cpp b/test/stdexec/algos/adaptors/test_bulk.cpp index 3b21654e0..e8ef4d16c 100644 --- a/test/stdexec/algos/adaptors/test_bulk.cpp +++ b/test/stdexec/algos/adaptors/test_bulk.cpp @@ -203,7 +203,7 @@ namespace check_err_types>(ex::just_error(n) | ex::bulk(ex::par, n, [](int) noexcept {})); check_err_types>(ex::just() | ex::continues_on(sched3) | ex::bulk(ex::par, n, [](int) noexcept {})); -# if !STDEXEC_NO_STD_EXCEPTIONS() +# if !STDEXEC_NO_STDCPP_EXCEPTIONS() check_err_types>( ex::just() | ex::continues_on(sched3) | ex::bulk(ex::par, n, [](int) { throw std::logic_error{"err"}; })); @@ -227,7 +227,7 @@ namespace | ex::bulk_chunked(ex::par, n, [](int, int) noexcept {})); check_err_types>(ex::just() | ex::continues_on(sched3) | ex::bulk_chunked(ex::par, n, [](int, int) noexcept {})); -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() check_err_types>( ex::just() | ex::continues_on(sched3) | ex::bulk_chunked(ex::par, n, [](int, int) { throw std::logic_error{"err"}; })); @@ -249,7 +249,7 @@ namespace | ex::bulk_unchunked(ex::par, n, [](int) noexcept {})); check_err_types>(ex::just() | ex::continues_on(sched3) | ex::bulk_unchunked(ex::par, n, [](int) noexcept {})); -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() check_err_types>( ex::just() | ex::continues_on(sched3) | ex::bulk_unchunked(ex::par, n, [](int) { throw std::logic_error{"err"}; })); @@ -611,7 +611,7 @@ namespace ex::start(op); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("bulk can throw, and set_error will be called", "[adaptors][bulk]") { constexpr int n = 2; @@ -640,7 +640,7 @@ namespace auto op = ex::connect(std::move(snd), expect_error_receiver{}); ex::start(op); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("bulk function is not called on error", "[adaptors][bulk]") { @@ -788,7 +788,7 @@ namespace } } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() SECTION("With exception") { constexpr int n = 9; @@ -797,7 +797,7 @@ namespace CHECK_THROWS_AS(ex::sync_wait(std::move(snd)), std::runtime_error); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() SECTION("With concurrent enqueueing") { @@ -923,7 +923,7 @@ namespace } } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() SECTION("With exception") { constexpr int n = 9; @@ -934,7 +934,7 @@ namespace CHECK_THROWS_AS(ex::sync_wait(std::move(snd)), std::runtime_error); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() SECTION("With concurrent enqueueing") { @@ -1049,7 +1049,7 @@ namespace } } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() SECTION("With exception") { auto const n = pool.available_parallelism(); @@ -1060,7 +1060,7 @@ namespace CHECK_THROWS_AS(ex::sync_wait(std::move(snd)), std::runtime_error); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() SECTION("With concurrent enqueueing") { diff --git a/test/stdexec/algos/adaptors/test_finally.cpp b/test/stdexec/algos/adaptors/test_finally.cpp index 83e16a01a..6530b1020 100644 --- a/test/stdexec/algos/adaptors/test_finally.cpp +++ b/test/stdexec/algos/adaptors/test_finally.cpp @@ -65,7 +65,7 @@ namespace CHECK(i == 42); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("finally does not execute the final action and throws integer", "[adaptors][finally]") { bool called = false; @@ -78,7 +78,7 @@ namespace CHECK_THROWS_AS(sync_wait(s), int); CHECK(called); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("finally includes the error types of the final action", "[adaptors][finally]") { diff --git a/test/stdexec/algos/adaptors/test_let_error.cpp b/test/stdexec/algos/adaptors/test_let_error.cpp index a50d5bae2..00f615207 100644 --- a/test/stdexec/algos/adaptors/test_let_error.cpp +++ b/test/stdexec/algos/adaptors/test_let_error.cpp @@ -94,7 +94,7 @@ namespace STDEXEC::sync_wait(std::move(snd)); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("let_error can be used to produce values (error to value)", "[adaptors][let_error]") { ex::sender auto snd = ex::just() | ex::then([]() -> std::string { @@ -137,7 +137,7 @@ namespace auto op = ex::connect(std::move(snd), expect_error_receiver{13}); ex::start(op); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("let_error can be used with just_stopped", "[adaptors][let_error]") { ex::sender auto snd = ex::just_stopped() diff --git a/test/stdexec/algos/adaptors/test_let_stopped.cpp b/test/stdexec/algos/adaptors/test_let_stopped.cpp index 9326279e9..8e87ab96e 100644 --- a/test/stdexec/algos/adaptors/test_let_stopped.cpp +++ b/test/stdexec/algos/adaptors/test_let_stopped.cpp @@ -82,7 +82,7 @@ namespace wait_for_value(std::move(snd), std::string{"cancelled"}); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("let_stopped can throw, calling set_error", "[adaptors][let_stopped]") { auto snd = ex::just_stopped() @@ -90,7 +90,7 @@ namespace auto op = ex::connect(std::move(snd), expect_error_receiver{}); ex::start(op); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("let_stopped can be used with just_error", "[adaptors][let_stopped]") { diff --git a/test/stdexec/algos/adaptors/test_let_value.cpp b/test/stdexec/algos/adaptors/test_let_value.cpp index 0d9a00c4a..8e12e1791 100644 --- a/test/stdexec/algos/adaptors/test_let_value.cpp +++ b/test/stdexec/algos/adaptors/test_let_value.cpp @@ -118,7 +118,7 @@ namespace return true; } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("let_value can be used for composition", "[adaptors][let_value]") { bool called1{false}; @@ -169,7 +169,7 @@ namespace auto op = ex::connect(std::move(snd), expect_error_receiver{}); ex::start(op); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("let_value can be used with just_error", "[adaptors][let_value]") { diff --git a/test/stdexec/algos/adaptors/test_then.cpp b/test/stdexec/algos/adaptors/test_then.cpp index d19a86815..5643a8b76 100644 --- a/test/stdexec/algos/adaptors/test_then.cpp +++ b/test/stdexec/algos/adaptors/test_then.cpp @@ -85,14 +85,14 @@ namespace wait_for_value(std::move(snd), 3.1415); // NOLINT(modernize-use-std-numbers) } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("then can throw, and set_error will be called", "[adaptors][then]") { auto snd = ex::just(13) | ex::then([](int) -> int { throw std::logic_error{"err"}; }); auto op = ex::connect(std::move(snd), expect_error_receiver{}); ex::start(op); } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("then can be used with just_error", "[adaptors][then]") { diff --git a/test/stdexec/algos/consumers/test_sync_wait.cpp b/test/stdexec/algos/consumers/test_sync_wait.cpp index e6c569407..c3a38f1c3 100644 --- a/test/stdexec/algos/consumers/test_sync_wait.cpp +++ b/test/stdexec/algos/consumers/test_sync_wait.cpp @@ -54,7 +54,7 @@ namespace CHECK(std::get<1>(res.value()) == 0.1415); } -#if !STDEXEC_NO_STD_EXCEPTIONS() +#if !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("sync_wait rethrows received exception", "[consumers][sync_wait]") { // Generate an exception pointer object @@ -125,7 +125,7 @@ namespace FAIL("expecting std::string exception to be thrown"); } } -#endif // !STDEXEC_NO_STD_EXCEPTIONS() +#endif // !STDEXEC_NO_STDCPP_EXCEPTIONS() TEST_CASE("sync_wait returns empty optional on cancellation", "[consumers][sync_wait]") { diff --git a/test/stdexec/concepts/test_awaitables.cpp b/test/stdexec/concepts/test_awaitables.cpp index c9877d459..019b4b420 100644 --- a/test/stdexec/concepts/test_awaitables.cpp +++ b/test/stdexec/concepts/test_awaitables.cpp @@ -22,7 +22,7 @@ #include -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() namespace ex = STDEXEC; @@ -282,4 +282,4 @@ namespace } } // namespace -#endif // STDEXEC_NO_STD_COROUTINES() +#endif // STDEXEC_NO_STDCPP_COROUTINES() diff --git a/test/stdexec/concepts/test_concepts_sender.cpp b/test/stdexec/concepts/test_concepts_sender.cpp index bc15b901e..5bc1952c3 100644 --- a/test/stdexec/concepts/test_concepts_sender.cpp +++ b/test/stdexec/concepts/test_concepts_sender.cpp @@ -57,7 +57,7 @@ namespace STATIC_REQUIRE(ex::sender); } -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() struct an_awaiter { auto await_ready() -> bool; diff --git a/test/stdexec/types/test_task.cpp b/test/stdexec/types/test_task.cpp index efcb1030d..15c3a6014 100644 --- a/test/stdexec/types/test_task.cpp +++ b/test/stdexec/types/test_task.cpp @@ -17,7 +17,7 @@ #include -#if !STDEXEC_NO_STD_COROUTINES() +#if !STDEXEC_NO_STDCPP_COROUTINES() # include @@ -262,4 +262,4 @@ namespace } // anonymous namespace -#endif // !STDEXEC_NO_STD_COROUTINES() +#endif // !STDEXEC_NO_STDCPP_COROUTINES()