diff --git a/.clang-format b/.clang-format index 87df19d0d..9028646bf 100644 --- a/.clang-format +++ b/.clang-format @@ -86,8 +86,8 @@ InsertTrailingCommas: None KeepEmptyLinesAtTheStartOfBlocks: false LambdaBodyIndentation: Signature LineEnding: LF -MacroBlockBegin: "^STDEXEC_NAMESPACE_STD_BEGIN$" -MacroBlockEnd: "^STDEXEC_NAMESPACE_STD_END$" +MacroBlockBegin: "^STDEXEC_NAMESPACE_STD_BEGIN|STDEXEC_P2300_NAMESPACE_BEGIN$" +MacroBlockEnd: "^STDEXEC_NAMESPACE_STD_END|STDEXEC_P2300_NAMESPACE_END$" Macros: [ 'STDEXEC_CATCH_FALLTHROUGH= ', 'STDEXEC_EXPLICIT_THIS_BEGIN(...)=__VA_ARGS__', diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index a0b3ec9d5..ec250c127 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -34,3 +34,6 @@ aee392a046a26ae2340849fe98e38332d9537397 # new formatting style for improved readability 0cccd586b8d75c64b289e38f334e95846dfb4f33 72666721b5787c1adcc100dd86c26fbbe8bda82f + +# inform clang-format that `STDEXEC_P2300_NAMESPACE_BEGIN()` opens a scope +9207f741ec54cb8d5e437385a083459da69ccaa6 diff --git a/include/stdexec/__detail/__basic_sender.hpp b/include/stdexec/__detail/__basic_sender.hpp index f8524ce56..93c4bdf17 100644 --- a/include/stdexec/__detail/__basic_sender.hpp +++ b/include/stdexec/__detail/__basic_sender.hpp @@ -111,7 +111,7 @@ namespace STDEXEC noexcept(__nothrow_decay_copyable<_CvData>) : __rcvr_(static_cast<_Receiver&&>(__rcvr)) , __data_(STDEXEC::__allocator_aware_forward(static_cast<_CvData&&>(__data), __rcvr_)) - { } + {} STDEXEC_IMMOVABLE_NO_UNIQUE_ADDRESS _Receiver __rcvr_; diff --git a/include/stdexec/__detail/__execution_fwd.hpp b/include/stdexec/__detail/__execution_fwd.hpp index e1f3d19b0..82fc4fa59 100644 --- a/include/stdexec/__detail/__execution_fwd.hpp +++ b/include/stdexec/__detail/__execution_fwd.hpp @@ -325,30 +325,30 @@ namespace experimental::execution namespace exec = experimental::execution; STDEXEC_P2300_NAMESPACE_BEGIN() -struct forwarding_query_t; -struct get_allocator_t; -struct get_stop_token_t; - -extern forwarding_query_t const forwarding_query; -extern get_allocator_t const get_allocator; -extern get_stop_token_t const get_stop_token; - -template -using stop_token_of_t = STDEXEC::__decay_t>; - -struct never_stop_token; -class inplace_stop_source; -class inplace_stop_token; -template -class inplace_stop_callback; + struct forwarding_query_t; + struct get_allocator_t; + struct get_stop_token_t; + + extern forwarding_query_t const forwarding_query; + extern get_allocator_t const get_allocator; + extern get_stop_token_t const get_stop_token; + + template + using stop_token_of_t = STDEXEC::__decay_t>; + + struct never_stop_token; + class inplace_stop_source; + class inplace_stop_token; + template + class inplace_stop_callback; STDEXEC_P2300_NAMESPACE_END() //////////////////////////////////////////////////////////////////////////////////////////////////// STDEXEC_P2300_NAMESPACE_BEGIN(this_thread) -struct sync_wait_t; -struct sync_wait_with_variant_t; -extern sync_wait_t const sync_wait; -extern sync_wait_with_variant_t const sync_wait_with_variant; + struct sync_wait_t; + struct sync_wait_with_variant_t; + extern sync_wait_t const sync_wait; + extern sync_wait_with_variant_t const sync_wait_with_variant; STDEXEC_P2300_NAMESPACE_END(this_thread) // NOT TO SPEC: make sync_wait et. al. available in namespace STDEXEC (possibly diff --git a/include/stdexec/__detail/__queries.hpp b/include/stdexec/__detail/__queries.hpp index 62df2b7b7..e96350b2d 100644 --- a/include/stdexec/__detail/__queries.hpp +++ b/include/stdexec/__detail/__queries.hpp @@ -134,31 +134,31 @@ namespace STDEXEC } // namespace STDEXEC STDEXEC_P2300_NAMESPACE_BEGIN() -////////////////////////////////////////////////////////////////////////////////// -// [exec.get.allocator] -struct get_allocator_t : STDEXEC::__query -{ - using STDEXEC::__query::operator(); + ////////////////////////////////////////////////////////////////////////////////// + // [exec.get.allocator] + struct get_allocator_t : STDEXEC::__query + { + using STDEXEC::__query::operator(); - // defined in __read_env.hpp - STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - constexpr auto operator()() const noexcept; + // defined in __read_env.hpp + STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) + constexpr auto operator()() const noexcept; - template - STDEXEC_ATTRIBUTE(always_inline, host, device) - static constexpr void __validate() noexcept - { - static_assert(STDEXEC::__nothrow_callable); - using __alloc_t = STDEXEC::__call_result_t; - static_assert(STDEXEC::__simple_allocator>); - } + template + STDEXEC_ATTRIBUTE(always_inline, host, device) + static constexpr void __validate() noexcept + { + static_assert(STDEXEC::__nothrow_callable); + using __alloc_t = STDEXEC::__call_result_t; + static_assert(STDEXEC::__simple_allocator>); + } - STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - static consteval auto query(forwarding_query_t) noexcept -> bool - { - return true; - } -}; + STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) + static consteval auto query(forwarding_query_t) noexcept -> bool + { + return true; + } + }; -inline constexpr get_allocator_t get_allocator{}; + inline constexpr get_allocator_t get_allocator{}; STDEXEC_P2300_NAMESPACE_END() diff --git a/include/stdexec/__detail/__query.hpp b/include/stdexec/__detail/__query.hpp index 1c694773a..d33c559ac 100644 --- a/include/stdexec/__detail/__query.hpp +++ b/include/stdexec/__detail/__query.hpp @@ -149,22 +149,22 @@ namespace STDEXEC } // namespace STDEXEC STDEXEC_P2300_NAMESPACE_BEGIN() -struct forwarding_query_t -{ - template - STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) - consteval auto operator()(_Query) const noexcept -> bool + struct forwarding_query_t { - if constexpr (STDEXEC::__queryable_with<_Query, forwarding_query_t>) - { - return STDEXEC::__query()(_Query()); - } - else + template + STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) + consteval auto operator()(_Query) const noexcept -> bool { - return STDEXEC::__std::derived_from<_Query, forwarding_query_t>; + if constexpr (STDEXEC::__queryable_with<_Query, forwarding_query_t>) + { + return STDEXEC::__query()(_Query()); + } + else + { + return STDEXEC::__std::derived_from<_Query, forwarding_query_t>; + } } - } -}; + }; -inline constexpr forwarding_query_t forwarding_query{}; + inline constexpr forwarding_query_t forwarding_query{}; STDEXEC_P2300_NAMESPACE_END() diff --git a/include/stdexec/__detail/__read_env.hpp b/include/stdexec/__detail/__read_env.hpp index 5262bf757..69836f473 100644 --- a/include/stdexec/__detail/__read_env.hpp +++ b/include/stdexec/__detail/__read_env.hpp @@ -178,15 +178,15 @@ namespace STDEXEC } // namespace STDEXEC STDEXEC_P2300_NAMESPACE_BEGIN() -STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) -constexpr auto get_allocator_t::operator()() const noexcept -{ - return STDEXEC::read_env(get_allocator); -} + STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) + constexpr auto get_allocator_t::operator()() const noexcept + { + return STDEXEC::read_env(get_allocator); + } -STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) -constexpr auto get_stop_token_t::operator()() const noexcept -{ - return STDEXEC::read_env(get_stop_token); -} + STDEXEC_ATTRIBUTE(nodiscard, always_inline, host, device) + constexpr auto get_stop_token_t::operator()() const noexcept + { + return STDEXEC::read_env(get_stop_token); + } STDEXEC_P2300_NAMESPACE_END() diff --git a/include/stdexec/__detail/__stop_token.hpp b/include/stdexec/__detail/__stop_token.hpp index c1339b366..53ee71137 100644 --- a/include/stdexec/__detail/__stop_token.hpp +++ b/include/stdexec/__detail/__stop_token.hpp @@ -26,80 +26,80 @@ STDEXEC_P2300_NAMESPACE_BEGIN() -template