diff --git a/.clang-format b/.clang-format
index 5f0cb09..d92a3f1 100644
--- a/.clang-format
+++ b/.clang-format
@@ -7,7 +7,9 @@
 AlignConsecutiveDeclarations: false
 AlignEscapedNewlines: Right
 AlignOperands:  Align
-AlignTrailingComments: true
+AlignTrailingComments:
+  Kind: Always
+  OverEmptyLines: 1
 AllowAllParametersOfDeclarationOnNextLine: true
 AllowShortBlocksOnASingleLine: Empty
 AllowShortCaseLabelsOnASingleLine: false
@@ -36,6 +38,7 @@
   SplitEmptyFunction:   false
   SplitEmptyRecord:     false
   SplitEmptyNamespace:  false
+BreakAfterAttributes: Never
 BreakBeforeBinaryOperators: None
 BreakBeforeBraces: Custom
 BreakBeforeTernaryOperators: true
@@ -78,7 +81,10 @@
 IndentRequiresClause: true
 IndentWidth:     4
 IndentWrappedFunctionNames: true
+InsertNewlineAtEOF: true
 KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
 MacroBlockBegin: ''
 MacroBlockEnd:   ''
 MaxEmptyLinesToKeep: 1
@@ -98,6 +104,7 @@
 ReferenceAlignment: Left
 ReflowComments:  true
 RequiresClausePosition: OwnLine
+RequiresExpressionIndentation: Keyword
 SortIncludes:    true
 SortUsingDeclarations: true
 SpaceAfterCStyleCast: false
@@ -117,7 +124,6 @@
 SpacesInSquareBrackets: false
 Standard:        Latest
 TabWidth:        4
-UseCRLF: false
 UseTab:          Never
 ...
 
diff --git a/example/asio-example.cpp b/example/asio-example.cpp
index ee89a2f..906059e 100644
--- a/example/asio-example.cpp
+++ b/example/asio-example.cpp
@@ -217,26 +217,26 @@
     iface->register_property("lessThan50", 23,
                              // custom set
                              [](const int& req, int& propertyValue) {
-                                 if (req >= 50)
-                                 {
-                                     return false;
-                                 }
-                                 propertyValue = req;
-                                 return true;
-                             });
+        if (req >= 50)
+        {
+            return false;
+        }
+        propertyValue = req;
+        return true;
+    });
     iface->register_property(
         "TrailTime", std::string("foo"),
         // custom set
         [](const std::string& req, std::string& propertyValue) {
-            propertyValue = req;
-            return true;
+        propertyValue = req;
+        return true;
         },
         // custom get
         [](const std::string& property) {
-            auto now = std::chrono::system_clock::now();
-            auto timePoint = std::chrono::system_clock::to_time_t(now);
-            return property + std::ctime(&timePoint);
-        });
+        auto now = std::chrono::system_clock::now();
+        auto timePoint = std::chrono::system_clock::to_time_t(now);
+        return property + std::ctime(&timePoint);
+    });
 
     // test method creation
     iface->register_method("TestMethod", [](const int32_t& callCount) {
@@ -250,8 +250,8 @@
     // so will be executed in coroutine context if called
     iface->register_method("TestYieldFunction",
                            [conn](boost::asio::yield_context yield, int val) {
-                               return fooYield(yield, conn, val);
-                           });
+        return fooYield(yield, conn, val);
+    });
 
     iface->register_method("TestMethodWithMessage", methodWithMessage);
 
@@ -324,16 +324,16 @@
 
     conn->async_method_call(
         [](boost::system::error_code ec, GetSubTreeType& subtree) {
-            std::cout << "async_method_call callback\n";
-            if (ec)
-            {
-                std::cerr << "error with async_method_call\n";
-                return;
-            }
-            for (auto& item : subtree)
-            {
-                std::cout << item.first << "\n";
-            }
+        std::cout << "async_method_call callback\n";
+        if (ec)
+        {
+            std::cerr << "error with async_method_call\n";
+            return;
+        }
+        for (auto& item : subtree)
+        {
+            std::cout << item.first << "\n";
+        }
         },
         "xyz.openbmc_project.ObjectMapper",
         "/xyz/openbmc_project/object_mapper",
@@ -345,17 +345,16 @@
         [nonConstCapture = std::move(nonConstCapture)](
             boost::system::error_code ec,
             const std::vector<std::string>& /*things*/) mutable {
-            std::cout << "async_method_call callback\n";
-            nonConstCapture += " stuff";
-            if (ec)
-            {
-                std::cerr << "async_method_call expected failure: " << ec
-                          << "\n";
-            }
-            else
-            {
-                std::cerr << "async_method_call should have failed!\n";
-            }
+        std::cout << "async_method_call callback\n";
+        nonConstCapture += " stuff";
+        if (ec)
+        {
+            std::cerr << "async_method_call expected failure: " << ec << "\n";
+        }
+        else
+        {
+            std::cerr << "async_method_call should have failed!\n";
+        }
         },
         "xyz.openbmc_project.ObjectMapper",
         "/xyz/openbmc_project/object_mapper",
@@ -384,14 +383,14 @@
 
     conn->async_method_call(
         [](boost::system::error_code ec, int32_t testValue) {
-            if (ec)
-            {
-                std::cerr << "TestYieldFunction returned error with "
-                             "async_method_call (ec = "
-                          << ec << ")\n";
-                return;
-            }
-            std::cout << "TestYieldFunction return " << testValue << "\n";
+        if (ec)
+        {
+            std::cerr << "TestYieldFunction returned error with "
+                         "async_method_call (ec = "
+                      << ec << ")\n";
+            return;
+        }
+        std::cout << "TestYieldFunction return " << testValue << "\n";
         },
         "xyz.openbmc_project.asio-test", "/xyz/openbmc_project/test",
         "xyz.openbmc_project.test", "TestYieldFunction", int32_t(41));
diff --git a/example/coroutine-example.cpp b/example/coroutine-example.cpp
index b402070..c077acd 100644
--- a/example/coroutine-example.cpp
+++ b/example/coroutine-example.cpp
@@ -32,29 +32,26 @@
     for (auto& [property, value] :
          co_await systemd.get_all_properties<variant_type>(ctx))
     {
-        std::cout
-            << property << " is "
-            << std::visit(
-                   // Convert the variant member to a string for printing.
-                   [](auto v) {
-                       if constexpr (std::is_same_v<
-                                         std::remove_cvref_t<decltype(v)>,
+        std::cout << property << " is "
+                  << std::visit(
+                         // Convert the variant member to a string for printing.
+                         [](auto v) {
+            if constexpr (std::is_same_v<std::remove_cvref_t<decltype(v)>,
                                          std::vector<std::string>>)
-                       {
-                           return std::string{"Array"};
-                       }
-                       else if constexpr (std::is_same_v<
-                                              std::remove_cvref_t<decltype(v)>,
+            {
+                return std::string{"Array"};
+            }
+            else if constexpr (std::is_same_v<std::remove_cvref_t<decltype(v)>,
                                               std::string>)
-                       {
-                           return v;
-                       }
-                       else
-                       {
-                           return std::to_string(v);
-                       }
-                   },
-                   value)
+            {
+                return v;
+            }
+            else
+            {
+                return std::to_string(v);
+            }
+                         },
+                         value)
             << std::endl;
     }
 
diff --git a/example/get-all-properties.cpp b/example/get-all-properties.cpp
index 428b322..711dd8b 100644
--- a/example/get-all-properties.cpp
+++ b/example/get-all-properties.cpp
@@ -33,8 +33,8 @@
         demo_->register_property_rw<std::string>(
             propertyGoodbyesName, sdbusplus::vtable::property_::emits_change,
             [this](const auto& newPropertyValue, const auto&) {
-                goodbyes_ = newPropertyValue;
-                return true;
+            goodbyes_ = newPropertyValue;
+            return true;
             },
             [this](const auto&) { return goodbyes_; });
 
@@ -95,7 +95,7 @@
                     const bool success = sdbusplus::unpackPropertiesNoThrow(
                         [this](const sdbusplus::UnpackErrorReason reason,
                                const std::string& property) {
-                            logUnpackError(reason, property);
+                    logUnpackError(reason, property);
                         },
                         properties, propertyGrettingName, greetings,
                         propertyGoodbyesName, goodbyes);
diff --git a/example/register-property.cpp b/example/register-property.cpp
index 3d2e86f..c22231a 100644
--- a/example/register-property.cpp
+++ b/example/register-property.cpp
@@ -24,18 +24,18 @@
         demo_ = objServer_.add_unique_interface(
             demoObjectPath, demoInterfaceName,
             [this](sdbusplus::asio::dbus_interface& demo) {
-                demo.register_property_r<std::string>(
-                    propertyGrettingName, sdbusplus::vtable::property_::const_,
-                    [this](const auto&) { return greetings_; });
+            demo.register_property_r<std::string>(
+                propertyGrettingName, sdbusplus::vtable::property_::const_,
+                [this](const auto&) { return greetings_; });
 
-                demo.register_property_rw<std::string>(
-                    propertyGoodbyesName,
-                    sdbusplus::vtable::property_::emits_change,
-                    [this](const auto& newPropertyValue, const auto&) {
-                        goodbyes_ = newPropertyValue;
-                        return true;
-                    },
-                    [this](const auto&) { return goodbyes_; });
+            demo.register_property_rw<std::string>(
+                propertyGoodbyesName,
+                sdbusplus::vtable::property_::emits_change,
+                [this](const auto& newPropertyValue, const auto&) {
+                goodbyes_ = newPropertyValue;
+                return true;
+                },
+                [this](const auto&) { return goodbyes_; });
             });
     }
 
@@ -58,17 +58,17 @@
             bus_, demoServiceName, demoObjectPath, demoInterfaceName,
             propertyGrettingName,
             [this](boost::system::error_code ec, uint32_t) {
-                if (ec)
-                {
-                    std::cout
-                        << "As expected failed to getProperty with wrong type: "
-                        << ec << "\n";
-                    return;
-                }
+            if (ec)
+            {
+                std::cout
+                    << "As expected failed to getProperty with wrong type: "
+                    << ec << "\n";
+                return;
+            }
 
-                std::cerr << "Error: it was expected to fail getProperty due "
-                             "to wrong type\n";
-                ++fatalErrors_;
+            std::cerr << "Error: it was expected to fail getProperty due "
+                         "to wrong type\n";
+            ++fatalErrors_;
             });
     }
 
@@ -78,24 +78,24 @@
             bus_, demoServiceName, demoObjectPath, demoInterfaceName,
             propertyGrettingName,
             [this](boost::system::error_code ec, std::string value) {
-                if (ec)
-                {
-                    getFailed();
-                    return;
-                }
-                std::cout << "Greetings value is: " << value << "\n";
+            if (ec)
+            {
+                getFailed();
+                return;
+            }
+            std::cout << "Greetings value is: " << value << "\n";
             });
 
         sdbusplus::asio::getProperty<std::string>(
             bus_, demoServiceName, demoObjectPath, demoInterfaceName,
             propertyGoodbyesName,
             [this](boost::system::error_code ec, std::string value) {
-                if (ec)
-                {
-                    getFailed();
-                    return;
-                }
-                std::cout << "Goodbyes value is: " << value << "\n";
+            if (ec)
+            {
+                getFailed();
+                return;
+            }
+            std::cout << "Goodbyes value is: " << value << "\n";
             });
     }
 
@@ -105,34 +105,31 @@
             bus_, demoServiceName, demoObjectPath, demoInterfaceName,
             propertyGrettingName, "Hi, hey, hello",
             [this](const boost::system::error_code& ec) {
-                if (ec)
-                {
-                    std::cout
-                        << "As expected, failed to set greetings property: "
-                        << ec << "\n";
-                    return;
-                }
+            if (ec)
+            {
+                std::cout << "As expected, failed to set greetings property: "
+                          << ec << "\n";
+                return;
+            }
 
-                std::cout
-                    << "Error: it was expected to fail to change greetings\n";
-                ++fatalErrors_;
+            std::cout << "Error: it was expected to fail to change greetings\n";
+            ++fatalErrors_;
             });
 
         sdbusplus::asio::setProperty(
             bus_, demoServiceName, demoObjectPath, demoInterfaceName,
             propertyGoodbyesName, "Bye bye",
             [this](const boost::system::error_code& ec) {
-                if (ec)
-                {
-                    std::cout
-                        << "Error: it supposed to be ok to change goodbyes "
-                           "property: "
-                        << ec << "\n";
-                    ++fatalErrors_;
-                    return;
-                }
-                std::cout << "Changed goodbyes property as expected\n";
-                boost::asio::post(ioc_, [this] { asyncReadProperties(); });
+            if (ec)
+            {
+                std::cout << "Error: it supposed to be ok to change goodbyes "
+                             "property: "
+                          << ec << "\n";
+                ++fatalErrors_;
+                return;
+            }
+            std::cout << "Changed goodbyes property as expected\n";
+            boost::asio::post(ioc_, [this] { asyncReadProperties(); });
             });
     }
 
diff --git a/include/sdbusplus/asio/connection.hpp b/include/sdbusplus/asio/connection.hpp
index 444f79d..084b484 100644
--- a/include/sdbusplus/asio/connection.hpp
+++ b/include/sdbusplus/asio/connection.hpp
@@ -130,9 +130,9 @@
         }();
         using UnpackType = utility::strip_first_n_args_t<returnWithMsg ? 2 : 1,
                                                          FunctionTupleType>;
-        auto applyHandler = [handler = std::forward<MessageHandler>(handler)](
-                                boost::system::error_code ec,
-                                message_t& r) mutable {
+        auto applyHandler =
+            [handler = std::forward<MessageHandler>(handler)](
+                boost::system::error_code ec, message_t& r) mutable {
             UnpackType responseData;
             if (!ec)
             {
@@ -317,18 +317,18 @@
         socket.async_read_some(
             boost::asio::null_buffers(),
             [&](const boost::system::error_code& ec, std::size_t) {
-                if (ec)
-                {
-                    return;
-                }
-                if (process_discard())
-                {
-                    read_immediate();
-                }
-                else
-                {
-                    read_wait();
-                }
+            if (ec)
+            {
+                return;
+            }
+            if (process_discard())
+            {
+                read_immediate();
+            }
+            else
+            {
+                read_wait();
+            }
             });
     }
     void read_immediate()
diff --git a/include/sdbusplus/asio/property.hpp b/include/sdbusplus/asio/property.hpp
index c528afe..28e99c4 100644
--- a/include/sdbusplus/asio/property.hpp
+++ b/include/sdbusplus/asio/property.hpp
@@ -52,21 +52,21 @@
         [handler = std::move(handler)](
             boost::system::error_code ec,
             std::variant<std::monostate, PropertyType>& ret) mutable {
-            if (ec)
-            {
-                handler(ec, {});
-                return;
-            }
+        if (ec)
+        {
+            handler(ec, {});
+            return;
+        }
 
-            if (PropertyType* value = std::get_if<PropertyType>(&ret))
-            {
-                handler(ec, std::move(*value));
-                return;
-            }
+        if (PropertyType* value = std::get_if<PropertyType>(&ret))
+        {
+            handler(ec, std::move(*value));
+            return;
+        }
 
-            handler(boost::system::errc::make_error_code(
-                        boost::system::errc::invalid_argument),
-                    {});
+        handler(boost::system::errc::make_error_code(
+                    boost::system::errc::invalid_argument),
+                {});
         },
         service, path, "org.freedesktop.DBus.Properties", "Get", interface,
         propertyName);
@@ -86,20 +86,20 @@
         [onError = std::move(onError), onSuccess = std::move(onSuccess)](
             boost::system::error_code ec,
             std::variant<std::monostate, T>& ret) {
-            if (ec)
-            {
-                onError(ec);
-                return;
-            }
+        if (ec)
+        {
+            onError(ec);
+            return;
+        }
 
-            if (T* value = std::get_if<T>(&ret))
-            {
-                onSuccess(*value);
-                return;
-            }
+        if (T* value = std::get_if<T>(&ret))
+        {
+            onSuccess(*value);
+            return;
+        }
 
-            onError(boost::system::errc::make_error_code(
-                boost::system::errc::invalid_argument));
+        onError(boost::system::errc::make_error_code(
+            boost::system::errc::invalid_argument));
         },
         service, path, "org.freedesktop.DBus.Properties", "Get", interface,
         propertyName);
diff --git a/include/sdbusplus/asio/sd_event.hpp b/include/sdbusplus/asio/sd_event.hpp
index 0c05daa..4a61a7c 100644
--- a/include/sdbusplus/asio/sd_event.hpp
+++ b/include/sdbusplus/asio/sd_event.hpp
@@ -114,11 +114,11 @@
     {
         descriptor.async_wait(boost::asio::posix::stream_descriptor::wait_read,
                               [this](const boost::system::error_code& error) {
-                                  if (!error)
-                                  {
-                                      run();
-                                  }
-                              });
+            if (!error)
+            {
+                run();
+            }
+        });
     }
     sd_event* evt;
     boost::asio::posix::stream_descriptor descriptor;
diff --git a/include/sdbusplus/async/proxy.hpp b/include/sdbusplus/async/proxy.hpp
index be006dd..5934a7e 100644
--- a/include/sdbusplus/async/proxy.hpp
+++ b/include/sdbusplus/async/proxy.hpp
@@ -133,12 +133,11 @@
 
         // Use 'callback' to perform the operation and "then" "unpack" the
         // contents.
-        return callback([bus = get_busp(ctx.get_bus()),
-                         msg = std::move(msg)](auto cb, auto data) mutable {
-                   return sd_bus_call_async(bus, nullptr, msg.get(), cb, data,
-                                            0);
-               }) |
-               execution::then([](message_t&& m) { return m.unpack<Rs...>(); });
+        return callback(
+                   [bus = get_busp(ctx.get_bus()),
+                    msg = std::move(msg)](auto cb, auto data) mutable {
+            return sd_bus_call_async(bus, nullptr, msg.get(), cb, data, 0);
+        }) | execution::then([](message_t&& m) { return m.unpack<Rs...>(); });
     }
 
     /** Get a property.
diff --git a/include/sdbusplus/async/scope.hpp b/include/sdbusplus/async/scope.hpp
index cc6c87a..06a30d7 100644
--- a/include/sdbusplus/async/scope.hpp
+++ b/include/sdbusplus/async/scope.hpp
@@ -227,7 +227,7 @@
 
     operator result_t()
     {
-        return ((Fn &&) fn)();
+        return ((Fn&&)fn)();
     }
 };
 
diff --git a/include/sdbusplus/async/stdexec/__detail/__intrusive_ptr.hpp b/include/sdbusplus/async/stdexec/__detail/__intrusive_ptr.hpp
index 3c163f0..feaaccc 100644
--- a/include/sdbusplus/async/stdexec/__detail/__intrusive_ptr.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__intrusive_ptr.hpp
@@ -46,7 +46,7 @@
         // Construct the value *after* the initialization of the
         // atomic in case the constructor of _Ty calls
         // __intrusive_from_this() (which increments the atomic):
-        ::new ((void*)__value_) _Ty{(_Us &&) __us...};
+        ::new ((void*)__value_) _Ty{(_Us&&)__us...};
     }
 
     ~__control_block()
@@ -195,7 +195,7 @@
     {
         using _UncvTy = std::remove_cv_t<_Ty>;
         return __intrusive_ptr<_Ty>{
-            ::new __control_block<_UncvTy>{(_Us &&) __us...}};
+            ::new __control_block<_UncvTy>{(_Us&&)__us...}};
     }
 };
 } // namespace __ptr
diff --git a/include/sdbusplus/async/stdexec/__detail/__meta.hpp b/include/sdbusplus/async/stdexec/__detail/__meta.hpp
index 5e2adde..35c43a5 100644
--- a/include/sdbusplus/async/stdexec/__detail/__meta.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__meta.hpp
@@ -282,7 +282,7 @@
 template <               //
     class _Continuation, //
     template <class...> class _Ap,
-    class... _As, //
+    class... _As,        //
     template <class...> class _Bp, class... _Bs>
     requires __minvocable<_Continuation, _As..., _Bs...>
 struct __mconcat_<_Continuation, _Ap<_As...>, _Bp<_Bs...>>
@@ -293,9 +293,9 @@
 template <               //
     class _Continuation, //
     template <class...> class _Ap,
-    class... _As, //
+    class... _As,        //
     template <class...> class _Bp,
-    class... _Bs, //
+    class... _Bs,        //
     template <class...> class _Cp, class... _Cs>
     requires __minvocable<_Continuation, _As..., _Bs..., _Cs...>
 struct __mconcat_<_Continuation, _Ap<_As...>, _Bp<_Bs...>, _Cp<_Cs...>>
@@ -306,13 +306,13 @@
 template <               //
     class _Continuation, //
     template <class...> class _Ap,
-    class... _As, //
+    class... _As,        //
     template <class...> class _Bp,
-    class... _Bs, //
+    class... _Bs,        //
     template <class...> class _Cp,
-    class... _Cs, //
+    class... _Cs,        //
     template <class...> class _Dp,
-    class... _Ds, //
+    class... _Ds,        //
     class... _Tail>
 struct __mconcat_<_Continuation, _Ap<_As...>, _Bp<_Bs...>, _Cp<_Cs...>,
                   _Dp<_Ds...>, _Tail...> :
@@ -589,16 +589,16 @@
 using __cvref_id = __copy_cvref_t<_From, __id<_To>>;
 
 template <class _Fun, class... _As>
-concept __callable =                         //
-    requires(_Fun&& __fun, _As&&... __as) {  //
-        ((_Fun &&) __fun)((_As &&) __as...); //
+concept __callable =                        //
+    requires(_Fun&& __fun, _As&&... __as) { //
+        ((_Fun&&)__fun)((_As&&)__as...);    //
     };
 template <class _Fun, class... _As>
 concept __nothrow_callable =    //
     __callable<_Fun, _As...> && //
     requires(_Fun&& __fun, _As&&... __as) {
         {
-            ((_Fun &&) __fun)((_As &&) __as...)
+            ((_Fun&&)__fun)((_As&&)__as...)
         } noexcept;
     };
 
@@ -636,12 +636,12 @@
 
     operator __t() && noexcept(__nothrow_callable<_Fn>)
     {
-        return ((_Fn &&) __fn_)();
+        return ((_Fn&&)__fn_)();
     }
 
     __t operator()() && noexcept(__nothrow_callable<_Fn>)
     {
-        return ((_Fn &&) __fn_)();
+        return ((_Fn&&)__fn_)();
     }
 };
 template <class _Fn>
@@ -664,7 +664,7 @@
     class _Fn,           //
     class _Continuation, //
     template <class...> class _Cp,
-    class... _Cs, //
+    class... _Cs,        //
     template <class...> class _Dp, class... _Ds>
     requires requires {
                  typename __minvoke<_Continuation, __minvoke<_Fn, _Cs, _Ds>...>;
@@ -806,10 +806,10 @@
 {
     template <class... _As>
     auto operator()(_As&&... __as) const
-        noexcept(__v<_Noexcept>&& noexcept(_Ty((_As &&) __as...)))
-            -> decltype(_Ty((_As &&) __as...))
+        noexcept(__v<_Noexcept>&& noexcept(_Ty((_As&&)__as...)))
+            -> decltype(_Ty((_As&&)__as...))
     {
-        return _Ty((_As &&) __as...);
+        return _Ty((_As&&)__as...);
     }
 };
 
@@ -822,18 +822,16 @@
 template <std::size_t... _Is, class _Ty, class... _Us>
 _Ty&& __nth_pack_element_(__ignore_t<_Is>..., _Ty&& __t, _Us&&...) noexcept
 {
-    return (_Ty &&) __t;
+    return (_Ty&&)__t;
 }
 
 template <std::size_t _Np, class... _Ts>
 constexpr decltype(auto) __nth_pack_element(_Ts&&... __ts) noexcept
 {
-    return [&]<std::size_t... _Is>(std::index_sequence<_Is...>*) noexcept
-        -> decltype(auto)
-    {
-        return stdexec::__nth_pack_element_<_Is...>((_Ts &&) __ts...);
-    }
-    ((std::make_index_sequence<_Np>*)nullptr);
+    return [&]<std::size_t... _Is>(
+               std::index_sequence<_Is...>*) noexcept -> decltype(auto) {
+        return stdexec::__nth_pack_element_<_Is...>((_Ts&&)__ts...);
+    }((std::make_index_sequence<_Np>*)nullptr);
 }
 
 template <class _Ty>
@@ -852,7 +850,7 @@
     template <class... _Ts>
     decltype(auto) operator()(_Ts&&... __ts) const noexcept
     {
-        return stdexec::__nth_pack_element<_Np>((_Ts &&) __ts...);
+        return stdexec::__nth_pack_element<_Np>((_Ts&&)__ts...);
     }
 };
 
@@ -893,13 +891,13 @@
         requires(__callable<__mdispatch_<_Args>, _Ts...> && ...) &&
                 __callable<_Ret,
                            __call_result_t<__mdispatch_<_Args>, _Ts...>...>
-                auto operator()(_Ts&&... __ts) const
-                noexcept(__nothrow_callable<
-                         _Ret, __call_result_t<__mdispatch_<_Args>, _Ts...>...>)
-                    -> __call_result_t<
-                        _Ret, __call_result_t<__mdispatch_<_Args>, _Ts...>...>
+    auto operator()(_Ts&&... __ts) const
+        noexcept(__nothrow_callable<
+                 _Ret, __call_result_t<__mdispatch_<_Args>, _Ts...>...>)
+            -> __call_result_t<_Ret,
+                               __call_result_t<__mdispatch_<_Args>, _Ts...>...>
     {
-        return _Ret{}(__mdispatch_<_Args>{}((_Ts &&) __ts...)...);
+        return _Ret{}(__mdispatch_<_Args>{}((_Ts&&)__ts...)...);
     }
 };
 
@@ -914,13 +912,13 @@
         requires(__callable<__mdispatch_<_Args>, _Ts...> && ...) &&
                 __callable<_Ret,
                            __call_result_t<__mdispatch_<_Args>, _Ts...>...>
-                auto operator()(_Ts&&... __ts) const
-                noexcept(__nothrow_callable<
-                         _Ret, __call_result_t<__mdispatch_<_Args>, _Ts...>...>)
-                    -> __call_result_t<
-                        _Ret, __call_result_t<__mdispatch_<_Args>, _Ts...>...>
+    auto operator()(_Ts&&... __ts) const
+        noexcept(__nothrow_callable<
+                 _Ret, __call_result_t<__mdispatch_<_Args>, _Ts...>...>)
+            -> __call_result_t<_Ret,
+                               __call_result_t<__mdispatch_<_Args>, _Ts...>...>
     {
-        return _Ret{}(__mdispatch_<_Args>{}((_Ts &&) __ts...)...);
+        return _Ret{}(__mdispatch_<_Args>{}((_Ts&&)__ts...)...);
     }
 };
 template <class _Ty, class... _Ts>
diff --git a/include/sdbusplus/async/stdexec/__detail/__p2300.hpp b/include/sdbusplus/async/stdexec/__detail/__p2300.hpp
index d76e65b..8bd2403 100644
--- a/include/sdbusplus/async/stdexec/__detail/__p2300.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__p2300.hpp
@@ -335,10 +335,10 @@
     stdexec::completion_signatures<_Sigs...>;
 
 // [exec.utils.mkcmplsigs]
-template <         //
-    class _Sender, //
+template <                                                        //
+    class _Sender,                                                //
     class _Env = stdexec::no_env,
-    class _Sigs = stdexec::completion_signatures<>, //
+    class _Sigs = stdexec::completion_signatures<>,               //
     template <class...>
     class _SetValue = stdexec::__compl_sigs::__default_set_value, //
     template <class>
diff --git a/include/sdbusplus/async/stdexec/__detail/__scope.hpp b/include/sdbusplus/async/stdexec/__detail/__scope.hpp
index 6f0f685..4f47839 100644
--- a/include/sdbusplus/async/stdexec/__detail/__scope.hpp
+++ b/include/sdbusplus/async/stdexec/__detail/__scope.hpp
@@ -33,7 +33,7 @@
     ~__scope_guard()
     {
         if (!__dismissed_)
-            ((_Fn &&) __fn_)();
+            ((_Fn&&)__fn_)();
     }
 
     void __dismiss() noexcept
@@ -59,7 +59,7 @@
     ~__scope_guard()
     {
         if (!__dismissed_)
-            ((_Fn &&) __fn_)((_T0 &&) __t0_);
+            ((_Fn&&)__fn_)((_T0&&)__t0_);
     }
 };
 
@@ -81,7 +81,7 @@
     ~__scope_guard()
     {
         if (!__dismissed_)
-            ((_Fn &&) __fn_)((_T0 &&) __t0_, (_T1 &&) __t1_);
+            ((_Fn&&)__fn_)((_T0&&)__t0_, (_T1&&)__t1_);
     }
 };
 
@@ -104,7 +104,7 @@
     ~__scope_guard()
     {
         if (!__dismissed_)
-            ((_Fn &&) __fn_)((_T0 &&) __t0_, (_T1 &&) __t1_, (_T2 &&) __t2_);
+            ((_Fn&&)__fn_)((_T0&&)__t0_, (_T1&&)__t1_, (_T2&&)__t2_);
     }
 };
 
diff --git a/include/sdbusplus/async/stdexec/any_sender_of.hpp b/include/sdbusplus/async/stdexec/any_sender_of.hpp
index 19e1b9e..c4b19f4 100644
--- a/include/sdbusplus/async/stdexec/any_sender_of.hpp
+++ b/include/sdbusplus/async/stdexec/any_sender_of.hpp
@@ -50,7 +50,7 @@
 
     _Ret operator()(_Tag, void* __rcvr, _As&&... __as) const
     {
-        return __fn_(__rcvr, (_As &&) __as...);
+        return __fn_(__rcvr, (_As&&)__as...);
     }
 };
 
@@ -61,7 +61,7 @@
 
     _Ret operator()(_Tag, void* __rcvr, _As&&... __as) const
     {
-        return __fn_(__rcvr, (_As &&) __as...);
+        return __fn_(__rcvr, (_As&&)__as...);
     }
 };
 
@@ -72,7 +72,7 @@
 
     _Ret operator()(_Tag, void* __rcvr, _As&&... __as) const noexcept
     {
-        return __fn_(__rcvr, (_As &&) __as...);
+        return __fn_(__rcvr, (_As&&)__as...);
     }
 };
 
@@ -83,7 +83,7 @@
 
     _Ret operator()(_Tag, void* __rcvr, _As&&... __as) const noexcept
     {
-        return __fn_(__rcvr, (_As &&) __as...);
+        return __fn_(__rcvr, (_As&&)__as...);
     }
 };
 
@@ -101,7 +101,7 @@
     {
         return +[](void* __env_provider, _As... __as) -> _Ret {
             return _Tag{}(get_env(*(const _EnvProvider*)__env_provider),
-                          (_As &&) __as...);
+                          (_As&&)__as...);
         };
     }
 
@@ -115,7 +115,7 @@
                 __nothrow_callable<_Tag, const env_of_t<_EnvProvider>&,
                                    _As...>);
             return _Tag{}(get_env(*(const _EnvProvider*)__env_provider),
-                          (_As &&) __as...);
+                          (_As&&)__as...);
         };
     }
 };
@@ -130,7 +130,7 @@
                         const noexcept)(void*, _As...)
     {
         return +[](void* __queryable, _As... __as) -> _Ret {
-            return _Tag{}(*(const _Queryable*)__queryable, (_As &&) __as...);
+            return _Tag{}(*(const _Queryable*)__queryable, (_As&&)__as...);
         };
     }
 
@@ -141,7 +141,7 @@
     {
         return +[](void* __env_provider, _As... __as) noexcept -> _Ret {
             static_assert(__nothrow_callable<_Tag, const _Queryable&, _As...>);
-            return _Tag{}(*(const _Queryable*)__env_provider, (_As &&) __as...);
+            return _Tag{}(*(const _Queryable*)__env_provider, (_As&&)__as...);
         };
     }
 };
@@ -156,7 +156,7 @@
 
     void operator()(_Tag, void* __storage, _As&&... __as) const
     {
-        return __fn_(__storage, (_As &&) __as...);
+        return __fn_(__storage, (_As&&)__as...);
     }
 };
 
@@ -167,7 +167,7 @@
 
     void operator()(_Tag, void* __storage, _As&&... __as) const noexcept
     {
-        return __fn_(__storage, (_As &&) __as...);
+        return __fn_(__storage, (_As&&)__as...);
     }
 };
 
@@ -181,7 +181,7 @@
     {
         return +[](void* __storage, _As... __as) -> void {
             return _Tag{}(__mtype<_Tp>{}, *(_Storage*)__storage,
-                          (_As &&) __as...);
+                          (_As&&)__as...);
         };
     }
 
@@ -194,7 +194,7 @@
             static_assert(
                 __nothrow_callable<_Tag, __mtype<_Tp>, _Storage&, _As...>);
             return _Tag{}(__mtype<_Tp>{}, *(_Storage*)__storage,
-                          (_As &&) __as...);
+                          (_As&&)__as...);
         };
     }
 };
@@ -242,7 +242,7 @@
         static_assert(nothrow_tag_invocable<__move_construct_t, __mtype<_Tp>,
                                             _Storage&, _Storage&&>);
         tag_invoke(__move_construct_t{}, __mtype<_Tp>{}, __self,
-                   (_Storage &&) __from);
+                   (_Storage&&)__from);
     }
 };
 
@@ -350,11 +350,11 @@
         using _Dp = __decay_t<_Tp>;
         if constexpr (__is_small<_Dp>)
         {
-            __construct_small<_Dp>((_Tp &&) __object);
+            __construct_small<_Dp>((_Tp&&)__object);
         }
         else
         {
-            __construct_large<_Dp>((_Tp &&) __object);
+            __construct_large<_Dp>((_Tp&&)__object);
         }
     }
 
@@ -365,11 +365,11 @@
     {
         if constexpr (__is_small<_Tp>)
         {
-            __construct_small<_Tp>((_Args &&) __args...);
+            __construct_small<_Tp>((_Args&&)__args...);
         }
         else
         {
-            __construct_large<_Tp>((_Args &&) __args...);
+            __construct_large<_Tp>((_Args&&)__args...);
         }
     }
 
@@ -388,13 +388,13 @@
 
     __t(__t&& __other) noexcept
     {
-        (*__other.__vtable_)(__move_construct, this, (__t &&) __other);
+        (*__other.__vtable_)(__move_construct, this, (__t&&)__other);
     }
 
     __t& operator=(__t&& __other) noexcept
     {
         __reset();
-        (*__other.__vtable_)(__move_construct, this, (__t &&) __other);
+        (*__other.__vtable_)(__move_construct, this, (__t&&)__other);
         return *this;
     }
 
@@ -431,7 +431,7 @@
             _Allocator>::template rebind_alloc<_Tp>;
         _Alloc __alloc{__allocator_};
         std::allocator_traits<_Alloc>::construct(__alloc, __pointer,
-                                                 (_As &&) __args...);
+                                                 (_As&&)__args...);
         __object_pointer_ = __pointer;
     }
 
@@ -445,7 +445,7 @@
         try
         {
             std::allocator_traits<_Alloc>::construct(__alloc, __pointer,
-                                                     (_As &&) __args...);
+                                                     (_As&&)__args...);
         }
         catch (...)
         {
@@ -487,7 +487,7 @@
         if constexpr (__is_small<_Tp>)
         {
             _Tp& __other_object = *__pointer;
-            __self.template __construct_small<_Tp>((_Tp &&) __other_object);
+            __self.template __construct_small<_Tp>((_Tp&&)__other_object);
             using _Alloc = typename std::allocator_traits<
                 _Allocator>::template rebind_alloc<_Tp>;
             _Alloc __alloc{__self.__allocator_};
@@ -563,7 +563,7 @@
                         const noexcept)(void*, _As...) noexcept
     {
         return +[](void* __rcvr, _As... __as) noexcept -> void {
-            _Tag{}((_Rcvr &&) * (_Rcvr*)__rcvr, (_As &&) __as...);
+            _Tag{}((_Rcvr&&)*(_Rcvr*)__rcvr, (_As&&)__as...);
         };
     }
 };
@@ -610,8 +610,7 @@
                 __nothrow_callable<const __vtable_t&, _Tag, void*, _As...>)
                 -> __call_result_t<const __vtable_t&, _Tag, void*, _As...>
         {
-            return (*__self.__vtable_)(_Tag{}, __self.__rcvr_,
-                                       (_As &&) __as...);
+            return (*__self.__vtable_)(_Tag{}, __self.__rcvr_, (_As&&)__as...);
         }
     } __env_;
 
@@ -630,7 +629,7 @@
     friend void tag_invoke(_Tag, _Self&& __self, _As&&... __as) noexcept
     {
         (*static_cast<const __rcvr_vfun<_Tag(_As...)>*>(__self.__env_.__vtable_)
-              ->__fn_)(((_Self &&) __self).__env_.__rcvr_, (_As &&) __as...);
+              ->__fn_)(((_Self&&)__self).__env_.__rcvr_, (_As&&)__as...);
     }
 
     template <std::same_as<__ref> Self>
@@ -690,8 +689,7 @@
             requires __callable<_CPO, _Receiver&&, _Args...>
         friend void tag_invoke(_CPO, _Self&& __self, _Args&&... __args) noexcept
         {
-            _CPO{}((_Receiver &&) __self.__op_->__receiver_,
-                   (_Args &&) __args...);
+            _CPO{}((_Receiver&&)__self.__op_->__receiver_, (_Args&&)__args...);
         }
 
         friend env_of_t<_Receiver> tag_invoke(get_env_t,
@@ -707,8 +705,8 @@
         using __id = __operation;
 
         __t(_Sender&& __sender, _Receiver&& __receiver) :
-            __operation_base<_Receiver, _Sigs, _Queries>{(_Receiver &&)
-                                                             __receiver},
+            __operation_base<_Receiver, _Sigs, _Queries>{
+                (_Receiver&&)__receiver},
             __storage_{__sender.__connect(__receiver_ref_t{__rec_})}
         {}
 
@@ -782,8 +780,8 @@
                         connect_result_t<_Sender, __receiver_ref_t>;
                     return __unique_operation_storage{
                         std::in_place_type<__op_state_t>, __conv{[&] {
-                            return connect((_Sender &&) __sender,
-                                           (__receiver_ref_t &&) __receiver);
+                            return connect((_Sender&&)__sender,
+                                           (__receiver_ref_t&&)__receiver);
                         }}};
                 }};
             return &__vtable_;
@@ -812,7 +810,7 @@
                                    void*, _As...>
         {
             return __self.__vtable_->__queries()(_Tag{}, __self.__sender_,
-                                                 (_As &&) __as...);
+                                                 (_As&&)__as...);
         }
     };
 
@@ -831,14 +829,14 @@
 
         template <__not_decays_to<__t> _Sender>
             requires sender_to<_Sender, __receiver_ref<_Sigs, _ReceiverQueries>>
-        __t(_Sender&& __sndr) : __storage_{(_Sender &&) __sndr}
+        __t(_Sender&& __sndr) : __storage_{(_Sender&&)__sndr}
         {}
 
         __unique_operation_storage __connect(__receiver_ref_t __receiver)
         {
             return __storage_.__get_vtable()->__connect_(
                 __storage_.__get_object_pointer(),
-                (__receiver_ref_t &&) __receiver);
+                (__receiver_ref_t&&)__receiver);
         }
 
         explicit operator bool() const noexcept
@@ -854,7 +852,7 @@
             __operation<__t, __decay_t<_Rcvr>, _ReceiverQueries>>
             tag_invoke(connect_t, __t&& __self, _Rcvr&& __rcvr)
         {
-            return {(__t &&) __self, (_Rcvr &&) __rcvr};
+            return {(__t&&)__self, (_Rcvr&&)__rcvr};
         }
 
         friend __env_t tag_invoke(get_env_t, const __t& __self) noexcept
@@ -872,7 +870,7 @@
     template <class _Scheduler>
         requires(!__decays_to<_Scheduler, __scheduler>) && scheduler<_Scheduler>
     __scheduler(_Scheduler&& __scheduler) :
-        __storage_{(_Scheduler &&) __scheduler}
+        __storage_{(_Scheduler&&)__scheduler}
     {}
 
     using __sender_t = _ScheduleSender;
@@ -934,7 +932,7 @@
                            void*, _As...>
     {
         return __self.__storage_.__get_vtable()->__queries()(
-            _Tag{}, __self.__storage_.__get_object_pointer(), (_As &&) __as...);
+            _Tag{}, __self.__storage_.__get_object_pointer(), (_As&&)__as...);
     }
 
     friend bool operator==(const __scheduler& __self,
@@ -984,8 +982,7 @@
         std::is_nothrow_invocable_v<
             _Tag, stdexec::__copy_cvref_t<Self, __receiver_base>, _As...>)
     {
-        return tag_invoke(_Tag{}, ((Self &&) __self).__receiver_,
-                          (_As &&) __as...);
+        return tag_invoke(_Tag{}, ((Self&&)__self).__receiver_, (_As&&)__as...);
     }
 
   public:
@@ -1016,8 +1013,8 @@
             std::is_nothrow_invocable_v<
                 _Tag, stdexec::__copy_cvref_t<Self, __sender_base>, _As...>)
         {
-            return tag_invoke(_Tag{}, ((Self &&) __self).__sender_,
-                              (_As &&) __as...);
+            return tag_invoke(_Tag{}, ((Self&&)__self).__sender_,
+                              (_As&&)__as...);
         }
 
       public:
@@ -1030,7 +1027,7 @@
                     stdexec::sender<_Sender>
         any_sender(_Sender&& __sender) noexcept(
             stdexec::__nothrow_constructible_from<__sender_base, _Sender>) :
-            __sender_((_Sender &&) __sender)
+            __sender_((_Sender&&)__sender)
         {}
 
         template <auto... _SchedulerQueries>
@@ -1077,7 +1074,7 @@
                 requires(!stdexec::__decays_to<_Scheduler, any_scheduler> &&
                          stdexec::scheduler<_Scheduler>)
             any_scheduler(_Scheduler&& __scheduler) :
-                __scheduler_{(_Scheduler &&) __scheduler}
+                __scheduler_{(_Scheduler&&)__scheduler}
             {}
 
           private:
@@ -1091,8 +1088,8 @@
                     _Tag, stdexec::__copy_cvref_t<Self, __scheduler_base>,
                     _As...>)
             {
-                return tag_invoke(_Tag{}, ((Self &&) __self).__scheduler_,
-                                  (_As &&) __as...);
+                return tag_invoke(_Tag{}, ((Self&&)__self).__scheduler_,
+                                  (_As&&)__as...);
             }
 
             friend bool
diff --git a/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp b/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp
index 4db9d6a..36eaf5c 100644
--- a/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp
+++ b/include/sdbusplus/async/stdexec/at_coroutine_exit.hpp
@@ -31,8 +31,8 @@
 {
 using namespace stdexec;
 
-using __any_scheduler = //
-    any_receiver_ref<   //
+using __any_scheduler =                         //
+    any_receiver_ref<                           //
         completion_signatures<set_error_t(std::exception_ptr),
                               set_stopped_t()>> //
     ::any_sender<>::any_scheduler<>;
@@ -52,8 +52,7 @@
             friend void tag_invoke(set_value_t, _Self&& __self,
                                    _Args&&... __args) noexcept
             {
-                set_value((_Receiver &&) __self.__receiver_,
-                          (_Args &&) __args...);
+                set_value((_Receiver&&)__self.__receiver_, (_Args&&)__args...);
             }
 
             template <__decays_to<__t> _Self, class _Error>
@@ -61,8 +60,7 @@
             friend void tag_invoke(set_error_t, _Self&& __self,
                                    _Error&& __error) noexcept
             {
-                set_error((_Receiver &&) __self.__receiver_,
-                          (_Error &&) __error);
+                set_error((_Receiver&&)__self.__receiver_, (_Error&&)__error);
             }
 
             [[noreturn]] friend void tag_invoke(set_stopped_t, __t&&) noexcept
@@ -100,8 +98,8 @@
             friend connect_result_t<_Sender, __receiver<_Receiver>>
                 tag_invoke(connect_t, __t&& __self, _Receiver&& __rcvr) noexcept
             {
-                return connect((_Sender &&) __self.__sender_,
-                               __receiver<_Receiver>{(_Receiver &&) __rcvr});
+                return connect((_Sender&&)__self.__sender_,
+                               __receiver<_Receiver>{(_Receiver&&)__rcvr});
             }
 
             template <__decays_to<__t> _Self, class _Env>
@@ -126,13 +124,13 @@
     __sender<_Sender> operator()(_Sender&& __sndr) const
         noexcept(__nothrow_decay_copyable<_Sender>)
     {
-        return __sender<_Sender>{(_Sender &&) __sndr};
+        return __sender<_Sender>{(_Sender&&)__sndr};
     }
 
     template <class _Value>
     _Value&& operator()(_Value&& __value) const noexcept
     {
-        return (_Value &&) __value;
+        return (_Value&&)__value;
     }
 };
 
@@ -143,7 +141,7 @@
     requires(_Promise& __promise, __continuation_handle<> __c) {
         {
             __promise.continuation()
-            } -> convertible_to<__continuation_handle<>>;
+        } -> convertible_to<__continuation_handle<>>;
         {
             __promise.set_continuation(__c)
         };
@@ -256,7 +254,7 @@
         template <class _Awaitable>
         decltype(auto) await_transform(_Awaitable&& __awaitable) noexcept
         {
-            return as_awaitable(__die_on_stop((_Awaitable &&) __awaitable),
+            return as_awaitable(__die_on_stop((_Awaitable&&)__awaitable),
                                 *this);
         }
 
@@ -279,7 +277,7 @@
     template <class _Action, class... _Ts>
     static __task<_Ts...> __impl(_Action __action, _Ts... __ts)
     {
-        co_await ((_Action &&) __action)((_Ts &&) __ts...);
+        co_await ((_Action&&)__action)((_Ts&&)__ts...);
     }
 
   public:
@@ -287,7 +285,7 @@
         requires __callable<__decay_t<_Action>, __decay_t<_Ts>...>
     __task<_Ts...> operator()(_Action&& __action, _Ts&&... __ts) const
     {
-        return __impl((_Action &&) __action, (_Ts &&) __ts...);
+        return __impl((_Action&&)__action, (_Ts&&)__ts...);
     }
 };
 } // namespace __at_coro_exit
diff --git a/include/sdbusplus/async/stdexec/concepts.hpp b/include/sdbusplus/async/stdexec/concepts.hpp
index 0e5cfb2..11dbe43 100644
--- a/include/sdbusplus/async/stdexec/concepts.hpp
+++ b/include/sdbusplus/async/stdexec/concepts.hpp
@@ -82,10 +82,10 @@
     requires(__cref_t<_Ty> __t) {
         {
             __t == __t
-            } -> convertible_to<bool>;
+        } -> convertible_to<bool>;
         {
             __t != __t
-            } -> convertible_to<bool>;
+        } -> convertible_to<bool>;
     };
 #endif
 } // namespace stdexec::__std_concepts
@@ -189,8 +189,7 @@
 concept __decays_to = __same_as<__decay_t<_Ty>, _Up>;
 
 template <class _Ty, class _Up>
-concept __not_decays_to = !
-__decays_to<_Ty, _Up>;
+concept __not_decays_to = !__decays_to<_Ty, _Up>;
 
 template <bool _TrueOrFalse>
 concept __satisfies = _TrueOrFalse;
@@ -208,7 +207,7 @@
 concept __all_of = (__same_as<_Ty, _Us> && ...);
 
 template <class _Ty, class... _Us>
-concept __none_of = ((!__same_as<_Ty, _Us>) && ...);
+concept __none_of = ((!__same_as<_Ty, _Us>)&&...);
 
 // Not exactly right, but close.
 template <class _Ty>
@@ -273,8 +272,8 @@
     //   const std::remove_reference_t<_RHS>&> &&
     requires(_LHS __lhs, _RHS&& __rhs) {
         {
-            __lhs = ((_RHS &&) __rhs)
-            } -> same_as<_LHS>;
+            __lhs = ((_RHS&&)__rhs)
+        } -> same_as<_LHS>;
     };
 
 namespace __swap
@@ -283,13 +282,13 @@
 
 template <class _Ty, class _Uy>
 concept swappable_with = //
-    requires(_Ty&& __t, _Uy&& __u) { swap((_Ty &&) __t, (_Uy &&) __u); };
+    requires(_Ty&& __t, _Uy&& __u) { swap((_Ty&&)__t, (_Uy&&)__u); };
 
 inline constexpr const auto __fn = //
     []<class _Ty, swappable_with<_Ty> _Uy>(_Ty&& __t, _Uy&& __u) noexcept(
-        noexcept(swap((_Ty &&) __t, (_Uy &&) __u))) {
-        swap((_Ty &&) __t, (_Uy &&) __u);
-    };
+        noexcept(swap((_Ty&&)__t, (_Uy&&)__u))) {
+    swap((_Ty&&)__t, (_Uy&&)__u);
+};
 } // namespace __swap
 
 using __swap::swappable_with;
@@ -329,28 +328,28 @@
     requires(__cref_t<T> t, __cref_t<U> u) {
         {
             t < u
-            } -> __boolean_testable_;
+        } -> __boolean_testable_;
         {
             t > u
-            } -> __boolean_testable_;
+        } -> __boolean_testable_;
         {
             t <= u
-            } -> __boolean_testable_;
+        } -> __boolean_testable_;
         {
             t >= u
-            } -> __boolean_testable_;
+        } -> __boolean_testable_;
         {
             u < t
-            } -> __boolean_testable_;
+        } -> __boolean_testable_;
         {
             u > t
-            } -> __boolean_testable_;
+        } -> __boolean_testable_;
         {
             u <= t
-            } -> __boolean_testable_;
+        } -> __boolean_testable_;
         {
             u >= t
-            } -> __boolean_testable_;
+        } -> __boolean_testable_;
     };
 
 template <class _Ty>
@@ -375,8 +374,7 @@
 concept __is_instance_of = __is_instance_of_<_Ay, _Ty>;
 
 template <class _Ay, template <class...> class _Ty>
-concept __is_not_instance_of = !
-__is_instance_of<_Ay, _Ty>;
+concept __is_not_instance_of = !__is_instance_of<_Ay, _Ty>;
 
 #if __has_builtin(__is_nothrow_constructible)
 template <class _Ty, class... _As>
diff --git a/include/sdbusplus/async/stdexec/coroutine.hpp b/include/sdbusplus/async/stdexec/coroutine.hpp
index ee0b6fd..3c5c4c8 100644
--- a/include/sdbusplus/async/stdexec/coroutine.hpp
+++ b/include/sdbusplus/async/stdexec/coroutine.hpp
@@ -43,7 +43,7 @@
     requires(_Awaiter& __await, __coro::coroutine_handle<_Promise> __h) {
         {
             __await.await_suspend(__h)
-            } -> __await_suspend_result;
+        } -> __await_suspend_result;
     };
 
 template <class _Awaiter, class _Promise = void>
@@ -57,45 +57,45 @@
 template <class _Awaitable>
 decltype(auto) __get_awaiter(_Awaitable&& __await, void*)
 {
-    if constexpr (requires { ((_Awaitable &&) __await).operator co_await(); })
+    if constexpr (requires { ((_Awaitable&&)__await).operator co_await(); })
     {
-        return ((_Awaitable &&) __await).operator co_await();
+        return ((_Awaitable&&)__await).operator co_await();
     }
-    else if constexpr (requires { operator co_await((_Awaitable &&) __await); })
+    else if constexpr (requires { operator co_await((_Awaitable&&)__await); })
     {
-        return operator co_await((_Awaitable &&) __await);
+        return operator co_await((_Awaitable&&)__await);
     }
     else
     {
-        return (_Awaitable &&) __await;
+        return (_Awaitable&&)__await;
     }
 }
 
 template <class _Awaitable, class _Promise>
 decltype(auto) __get_awaiter(_Awaitable&& __await, _Promise* __promise)
-    requires requires { __promise->await_transform((_Awaitable &&) __await); }
+    requires requires { __promise->await_transform((_Awaitable&&)__await); }
 {
     if constexpr (requires {
-                      __promise->await_transform((_Awaitable &&) __await)
+                      __promise->await_transform((_Awaitable&&)__await)
                           .
                           operator co_await();
                   })
     {
-        return __promise->await_transform((_Awaitable &&) __await)
+        return __promise->await_transform((_Awaitable&&)__await)
             .
             operator co_await();
     }
     else if constexpr (requires {
                            operator co_await(__promise->await_transform(
-                               (_Awaitable &&) __await));
+                               (_Awaitable&&)__await));
                        })
     {
         return operator co_await(
-            __promise->await_transform((_Awaitable &&) __await));
+            __promise->await_transform((_Awaitable&&)__await));
     }
     else
     {
-        return __promise->await_transform((_Awaitable &&) __await);
+        return __promise->await_transform((_Awaitable&&)__await);
     }
 }
 
@@ -103,8 +103,8 @@
 concept __awaitable = //
     requires(_Awaitable&& __await, _Promise* __promise) {
         {
-            stdexec::__get_awaiter((_Awaitable &&) __await, __promise)
-            } -> __awaiter<_Promise>;
+            stdexec::__get_awaiter((_Awaitable&&)__await, __promise)
+        } -> __awaiter<_Promise>;
     };
 
 template <class _Tp>
diff --git a/include/sdbusplus/async/stdexec/execution.hpp b/include/sdbusplus/async/stdexec/execution.hpp
index d0f0bb1..33e5ae5 100644
--- a/include/sdbusplus/async/stdexec/execution.hpp
+++ b/include/sdbusplus/async/stdexec/execution.hpp
@@ -87,7 +87,7 @@
     {
         if constexpr (tag_invocable<forwarding_query_t, _Query>)
         {
-            return tag_invoke(*this, (_Query &&) __query);
+            return tag_invoke(*this, (_Query&&)__query);
         }
         else if constexpr (std::derived_from<_Query, forwarding_query_t>)
         {
@@ -215,7 +215,7 @@
 
         [[no_unique_address]] __val_or_ref_t __value_;
 
-        __t(__with&& __w) : __value_(((__with &&) __w).__value_) {}
+        __t(__with&& __w) : __value_(((__with&&)__w).__value_) {}
 
         template <same_as<_Tag> _Tp, class... _Ts>
         friend __val_or_ref_t tag_invoke(_Tp, const __t& __self, _Ts&&...) //
@@ -246,7 +246,7 @@
 template <__class _Tag, class _Value>
 __with<_Tag, __decay_t<_Value>> __with_(_Tag, _Value&& __val)
 {
-    return {(_Value &&) __val};
+    return {(_Value&&)__val};
 }
 
 template <__class _Tag>
@@ -273,12 +273,12 @@
         template <__forwarding_query _Tag, same_as<__t> _Self, class... _As>
             requires __none_of<_Tag, __tag_of<_WithIds>...> &&
                      __callable<_Tag, const __base_env_of<_Self>&, _As...>
-                     friend auto tag_invoke(_Tag __tag, const _Self& __self,
-                                            _As&&... __as) noexcept
-                     -> __call_result_if_t<same_as<_Self, __t>, _Tag,
-                                           const __base_env_of<_Self>&, _As...>
+        friend auto tag_invoke(_Tag __tag, const _Self& __self,
+                               _As&&... __as) noexcept
+            -> __call_result_if_t<same_as<_Self, __t>, _Tag,
+                                  const __base_env_of<_Self>&, _As...>
         {
-            return ((_Tag &&) __tag)(__self.__base_env_, (_As &&) __as...);
+            return ((_Tag&&)__tag)(__self.__base_env_, (_As&&)__as...);
         }
     };
 };
@@ -305,7 +305,7 @@
     auto operator()(_BaseEnv&& __base_env, __with<_Tags, _Values>... __ws) const
         -> __env_t<__decay_t<_BaseEnv>, __with<_Tags, _Values>...>
     {
-        return {{std::move(__ws)}..., (_BaseEnv &&) __base_env};
+        return {{std::move(__ws)}..., (_BaseEnv&&)__base_env};
     }
 
     template <class... _Tags, class... _Values>
@@ -370,12 +370,12 @@
     requires(_EnvProvider& __ep) {
         {
             get_env(std::as_const(__ep))
-            } -> queryable;
+        } -> queryable;
         // NOT TO SPEC: Remove the following line when we deprecate all
         // R5 entities.
         {
             get_env(std::as_const(__ep))
-            } -> __none_of<no_env, void>;
+        } -> __none_of<no_env, void>;
     };
 
 /////////////////////////////////////////////////////////////////////////////
@@ -394,8 +394,7 @@
         operator()(_Receiver&& __rcvr, _As&&... __as) const noexcept
     {
         static_assert(nothrow_tag_invocable<set_value_t, _Receiver, _As...>);
-        (void)tag_invoke(set_value_t{}, (_Receiver &&) __rcvr,
-                         (_As &&) __as...);
+        (void)tag_invoke(set_value_t{}, (_Receiver&&)__rcvr, (_As&&)__as...);
     }
 };
 
@@ -412,8 +411,7 @@
         operator()(_Receiver&& __rcvr, _Error&& __err) const noexcept
     {
         static_assert(nothrow_tag_invocable<set_error_t, _Receiver, _Error>);
-        (void)tag_invoke(set_error_t{}, (_Receiver &&) __rcvr,
-                         (_Error &&) __err);
+        (void)tag_invoke(set_error_t{}, (_Receiver&&)__rcvr, (_Error&&)__err);
     }
 };
 
@@ -430,7 +428,7 @@
         operator()(_Receiver&& __rcvr) const noexcept
     {
         static_assert(nothrow_tag_invocable<set_stopped_t, _Receiver>);
-        (void)tag_invoke(set_stopped_t{}, (_Receiver &&) __rcvr);
+        (void)tag_invoke(set_stopped_t{}, (_Receiver&&)__rcvr);
     }
 };
 } // namespace __receivers
@@ -455,17 +453,17 @@
     {
         if constexpr (__nothrow_callable<_Fun, _Args...>)
         {
-            ((_Fun &&) __fun)((_Args &&) __args...);
+            ((_Fun&&)__fun)((_Args&&)__args...);
         }
         else
         {
             try
             {
-                ((_Fun &&) __fun)((_Args &&) __args...);
+                ((_Fun&&)__fun)((_Args&&)__args...);
             }
             catch (...)
             {
-                set_error((_Receiver &&) __rcvr, std::current_exception());
+                set_error((_Receiver&&)__rcvr, std::current_exception());
             }
         }
     }
@@ -525,7 +523,7 @@
     template <class _Ty>
     _Ty&& await_transform(_Ty&& __value) noexcept
     {
-        return (_Ty &&) __value;
+        return (_Ty&&)__value;
     }
 
     template <class _Ty>
@@ -534,7 +532,7 @@
         noexcept(nothrow_tag_invocable<as_awaitable_t, _Ty, __env_promise&>)
             -> tag_invoke_result_t<as_awaitable_t, _Ty, __env_promise&>
     {
-        return tag_invoke(as_awaitable, (_Ty &&) __value, *this);
+        return tag_invoke(as_awaitable, (_Ty&&)__value, *this);
     }
 
     friend auto tag_invoke(get_env_t, const __env_promise&) noexcept
@@ -653,7 +651,7 @@
     {};
 
     friend auto operator,(_MISSING_COMPLETION_SIGNAL_, auto)
-                             -> _MISSING_COMPLETION_SIGNAL_
+        -> _MISSING_COMPLETION_SIGNAL_
     {
         return {};
     }
@@ -683,8 +681,7 @@
 
 template <class _Completion, class _Receiver>
 concept __is_valid_completion = //
-    _Completion::template
-_WITH_RECEIVER_<_Receiver>::value;
+    _Completion::template _WITH_RECEIVER_<_Receiver>::value;
 } // namespace __receiver_concepts
 
 using __receiver_concepts::__has_completions;
@@ -721,8 +718,8 @@
     requires(_Completions* __required_completions) {
         {
             __has_completions<__decay_t<_Receiver>>(__required_completions)
-            } //
-                ->__is_valid_completion<__decay_t<_Receiver>>;
+        } //
+            ->__is_valid_completion<__decay_t<_Receiver>>;
     };
 
 /////////////////////////////////////////////////////////////////////////////
@@ -1022,12 +1019,12 @@
 using __ensure_concat =
     __minvoke<__mconcat<__q<completion_signatures>>, _Sigs...>;
 
-template <           //
-    class _Sender,   //
-    class _Env,      //
-    class _Sigs,     //
-    class _SetValue, //
-    class _SetError, //
+template <             //
+    class _Sender,     //
+    class _Env,        //
+    class _Sigs,       //
+    class _SetValue,   //
+    class _SetError,   //
     class _SetStopped>
 using __compl_sigs_t = //
     __concat_completion_signatures_t<
@@ -1159,8 +1156,8 @@
         if constexpr (tag_invocable<forwarding_scheduler_query_t, _Tag>)
         {
             static_assert(
-                noexcept(tag_invoke(*this, (_Tag &&) __tag) ? true : false));
-            return tag_invoke(*this, (_Tag &&) __tag) ? true : false;
+                noexcept(tag_invoke(*this, (_Tag&&)__tag) ? true : false));
+            return tag_invoke(*this, (_Tag&&)__tag) ? true : false;
         }
         else
         {
@@ -1187,7 +1184,7 @@
         operator()(_Scheduler&& __sched) const
         noexcept(nothrow_tag_invocable<schedule_t, _Scheduler>)
     {
-        return tag_invoke(schedule_t{}, (_Scheduler &&) __sched);
+        return tag_invoke(schedule_t{}, (_Scheduler&&)__sched);
     }
 
     friend constexpr bool tag_invoke(forwarding_scheduler_query_t, schedule_t)
@@ -1205,9 +1202,7 @@
 concept tag_category = //
     requires {
         typename __mbool<bool{_Predicate(_Tag{})}>;
-        requires bool {
-            _Predicate(_Tag{})
-        };
+        requires bool{_Predicate(_Tag{})};
     };
 
 // [execution.schedulers.queries], scheduler queries
@@ -1282,8 +1277,8 @@
 concept __has_schedule = //
     requires(_Scheduler&& __sched) {
         {
-            schedule((_Scheduler &&) __sched)
-            } -> sender;
+            schedule((_Scheduler&&)__sched)
+        } -> sender;
     };
 
 template <class _Scheduler>
@@ -1292,8 +1287,8 @@
              const get_completion_scheduler_t<set_value_t>&& __tag) {
         {
             tag_invoke(std::move(__tag),
-                       get_env(schedule((_Scheduler &&) __sched)))
-            } -> same_as<__decay_t<_Scheduler>>;
+                       get_env(schedule((_Scheduler&&)__sched)))
+        } -> same_as<__decay_t<_Scheduler>>;
     };
 
 template <class _Scheduler>
@@ -1326,8 +1321,8 @@
     template <__none_of<no_env> _Env>
         requires tag_invocable<get_scheduler_t, const _Env&> &&
                  scheduler<tag_invoke_result_t<get_scheduler_t, const _Env&>>
-                 auto operator()(const _Env& __env) const noexcept
-                 -> tag_invoke_result_t<get_scheduler_t, const _Env&>
+    auto operator()(const _Env& __env) const noexcept
+        -> tag_invoke_result_t<get_scheduler_t, const _Env&>
     {
         static_assert(nothrow_tag_invocable<get_scheduler_t, const _Env&>);
         return tag_invoke(get_scheduler_t{}, __env);
@@ -1349,11 +1344,9 @@
                                        __cref_t<_Tp>> &&
                  scheduler<tag_invoke_result_t<get_delegatee_scheduler_t,
                                                __cref_t<_Tp>>>
-                 auto operator()(_Tp&& __t) const
-                 noexcept(nothrow_tag_invocable<get_delegatee_scheduler_t,
-                                                __cref_t<_Tp>>)
-                     -> tag_invoke_result_t<get_delegatee_scheduler_t,
-                                            __cref_t<_Tp>>
+    auto operator()(_Tp&& __t) const noexcept(
+        nothrow_tag_invocable<get_delegatee_scheduler_t, __cref_t<_Tp>>)
+        -> tag_invoke_result_t<get_delegatee_scheduler_t, __cref_t<_Tp>>
     {
         return tag_invoke(get_delegatee_scheduler_t{}, std::as_const(__t));
     }
@@ -1372,9 +1365,9 @@
     template <__none_of<no_env> _Env>
         requires nothrow_tag_invocable<get_allocator_t, const _Env&> &&
                  __allocator<tag_invoke_result_t<get_allocator_t, const _Env&>>
-                 auto operator()(const _Env& __env) const
-                 noexcept(nothrow_tag_invocable<get_allocator_t, const _Env&>)
-                     -> tag_invoke_result_t<get_allocator_t, const _Env&>
+    auto operator()(const _Env& __env) const
+        noexcept(nothrow_tag_invocable<get_allocator_t, const _Env&>)
+            -> tag_invoke_result_t<get_allocator_t, const _Env&>
     {
         return tag_invoke(get_allocator_t{}, __env);
     }
@@ -1400,9 +1393,9 @@
         requires tag_invocable<get_stop_token_t, const _Env&> &&
                  stoppable_token<
                      tag_invoke_result_t<get_stop_token_t, const _Env&>>
-                 auto operator()(const _Env& __env) const
-                 noexcept(nothrow_tag_invocable<get_stop_token_t, const _Env&>)
-                     -> tag_invoke_result_t<get_stop_token_t, const _Env&>
+    auto operator()(const _Env& __env) const
+        noexcept(nothrow_tag_invocable<get_stop_token_t, const _Env&>)
+            -> tag_invoke_result_t<get_stop_token_t, const _Env&>
     {
         return tag_invoke(get_stop_token_t{}, __env);
     }
@@ -1432,7 +1425,7 @@
     requires(const _SchedulerProvider& __sp) {
         {
             get_scheduler(__sp)
-            } -> scheduler<>;
+        } -> scheduler<>;
     };
 
 /////////////////////////////////////////////////////////////////////////////
@@ -1542,7 +1535,7 @@
 
         __coro::coroutine_handle<> unhandled_stopped() noexcept
         {
-            set_stopped((_Receiver &&) __rcvr_);
+            set_stopped((_Receiver&&)__rcvr_);
             // Returning noop_coroutine here causes the __connect_awaitable
             // coroutine to never resume past the point where it co_await's
             // the awaitable.
@@ -1558,7 +1551,7 @@
         template <class _Awaitable>
         _Awaitable&& await_transform(_Awaitable&& __await) noexcept
         {
-            return (_Awaitable &&) __await;
+            return (_Awaitable&&)__await;
         }
 
         template <class _Awaitable>
@@ -1567,7 +1560,7 @@
             noexcept(nothrow_tag_invocable<as_awaitable_t, _Awaitable, __t&>)
                 -> tag_invoke_result_t<as_awaitable_t, _Awaitable, __t&>
         {
-            return tag_invoke(as_awaitable, (_Awaitable &&) __await, *this);
+            return tag_invoke(as_awaitable, (_Awaitable&&)__await, *this);
         }
 
         // Pass through the get_env receiver query
@@ -1593,7 +1586,7 @@
     template <class _Fun, class... _Ts>
     static auto __co_call(_Fun __fun, _Ts&&... __as) noexcept
     {
-        auto __fn = [&, __fun]() noexcept { __fun((_Ts &&) __as...); };
+        auto __fn = [&, __fun]() noexcept { __fun((_Ts&&)__as...); };
 
         struct __awaiter
         {
@@ -1627,24 +1620,24 @@
         try
         {
             if constexpr (same_as<__result_t, void>)
-                co_await (co_await (_Awaitable &&) __await,
-                          __co_call(set_value, (_Receiver &&) __rcvr));
+                co_await (co_await (_Awaitable&&) __await,
+                          __co_call(set_value, (_Receiver&&)__rcvr));
             else
-                co_await __co_call(set_value, (_Receiver &&) __rcvr,
-                                   co_await (_Awaitable &&) __await);
+                co_await __co_call(set_value, (_Receiver&&)__rcvr,
+                                   co_await (_Awaitable&&) __await);
         }
         catch (...)
         {
             __eptr = std::current_exception();
         }
-        co_await __co_call(set_error, (_Receiver &&) __rcvr,
-                           (std::exception_ptr &&) __eptr);
+        co_await __co_call(set_error, (_Receiver&&)__rcvr,
+                           (std::exception_ptr&&)__eptr);
     }
 
     template <receiver _Receiver, class _Awaitable>
     using __completions_t = //
         completion_signatures<
-            __minvoke< // set_value_t() or set_value_t(T)
+            __minvoke<      // set_value_t() or set_value_t(T)
                 __remove<void, __qf<set_value_t>>,
                 __await_result_t<_Awaitable, __promise_t<_Receiver>>>,
             set_error_t(std::exception_ptr), set_stopped_t()>;
@@ -1655,7 +1648,7 @@
     __operation_t<_Receiver> operator()(_Awaitable&& __await,
                                         _Receiver __rcvr) const
     {
-        return __co_impl((_Awaitable &&) __await, (_Receiver &&) __rcvr);
+        return __co_impl((_Awaitable&&)__await, (_Receiver&&)__rcvr);
     }
 };
 } // namespace __connect_awaitable_
@@ -1680,7 +1673,7 @@
                       std::is_invocable_r_v<bool, tag_t<tag_invoke>,
                                             forwarding_sender_query_t, _Tag>)
         {
-            return tag_invoke(*this, (_Tag &&) __tag);
+            return tag_invoke(*this, (_Tag&&)__tag);
         }
         else
         {
@@ -1829,10 +1822,9 @@
         requires __connectable_with_tag_invoke<_Sender, _Receiver> ||
                  __callable<__connect_awaitable_t, _Sender, _Receiver> ||
                  tag_invocable<__is_debug_env_t, env_of_t<_Receiver>>
-                 auto operator()(_Sender&& __sndr, _Receiver&& __rcvr) const
-                 noexcept(
-                     __nothrow_callable<__select_impl_t<_Sender, _Receiver>>)
-                     -> __call_result_t<__select_impl_t<_Sender, _Receiver>>
+    auto operator()(_Sender&& __sndr, _Receiver&& __rcvr) const
+        noexcept(__nothrow_callable<__select_impl_t<_Sender, _Receiver>>)
+            -> __call_result_t<__select_impl_t<_Sender, _Receiver>>
     {
         if constexpr (__connectable_with_tag_invoke<_Sender, _Receiver>)
         {
@@ -1841,21 +1833,20 @@
                     tag_invoke_result_t<connect_t, _Sender, _Receiver>>,
                 "stdexec::connect(sender, receiver) must return a type that "
                 "satisfies the operation_state concept");
-            return tag_invoke(connect_t{}, (_Sender &&) __sndr,
-                              (_Receiver &&) __rcvr);
+            return tag_invoke(connect_t{}, (_Sender&&)__sndr,
+                              (_Receiver&&)__rcvr);
         }
         else if constexpr (__callable<__connect_awaitable_t, _Sender,
                                       _Receiver>)
         {
-            return __connect_awaitable((_Sender &&) __sndr,
-                                       (_Receiver &&) __rcvr);
+            return __connect_awaitable((_Sender&&)__sndr, (_Receiver&&)__rcvr);
         }
         else
         {
             // This should generate an instantiate backtrace that contains
             // useful debugging information.
             using __tag_invoke::tag_invoke;
-            tag_invoke(*this, (_Sender &&) __sndr, (_Receiver &&) __rcvr);
+            tag_invoke(*this, (_Sender&&)__sndr, (_Receiver&&)__rcvr);
         }
     }
 
@@ -1874,8 +1865,8 @@
 using connect_result_t = __call_result_t<connect_t, _Sender, _Receiver>;
 
 template <class _Sender, class _Receiver>
-concept __nothrow_connectable = noexcept(connect(__declval<_Sender>(),
-                                                 __declval<_Receiver>()));
+concept __nothrow_connectable =
+    noexcept(connect(__declval<_Sender>(), __declval<_Receiver>()));
 
 ////////////////////////////////////////////////////////////////////////////
 // `__debug_sender`
@@ -1930,21 +1921,21 @@
 void __debug_sender(_Sender&& __sndr, _Env = {})
 {
     using _Receiver = __debug_receiver<_Env, _Sigs>;
-    (void)connect_t{}((_Sender &&) __sndr, _Receiver{});
+    (void)connect_t{}((_Sender&&)__sndr, _Receiver{});
 }
 
 template <class _Sender>
 void __debug_sender(_Sender&& __sndr)
 {
     using _Receiver = __any_debug_receiver<empty_env>;
-    (void)connect_t{}((_Sender &&) __sndr, _Receiver{});
+    (void)connect_t{}((_Sender&&)__sndr, _Receiver{});
 }
 
 template <class _Env, class _Sender>
 void __debug_sender(_Sender&& __sndr, _Env)
 {
     using _Receiver = __any_debug_receiver<_Env>;
-    (void)connect_t{}((_Sender &&) __sndr, _Receiver{});
+    (void)connect_t{}((_Sender&&)__sndr, _Receiver{});
 }
 } // namespace __debug
 
@@ -1957,7 +1948,7 @@
                     sender_in<_Sender, env_of_t<_Receiver>> && //
                     __receiver_from<_Receiver, _Sender> &&     //
                     requires(_Sender&& __sndr, _Receiver&& __rcvr) {
-                        connect((_Sender &&) __sndr, (_Receiver &&) __rcvr);
+                        connect((_Sender&&)__sndr, (_Receiver&&)__rcvr);
                     };
 
 template <class _Tag, class... _Args>
@@ -1996,9 +1987,8 @@
         requires tag_invocable<get_completion_scheduler_t, const _Queryable&> &&
                  scheduler<tag_invoke_result_t<get_completion_scheduler_t,
                                                const _Queryable&>>
-                 auto operator()(const _Queryable& __queryable) const noexcept
-                 -> tag_invoke_result_t<get_completion_scheduler_t,
-                                        const _Queryable&>
+    auto operator()(const _Queryable& __queryable) const noexcept
+        -> tag_invoke_result_t<get_completion_scheduler_t, const _Queryable&>
     {
         // NOT TO SPEC:
         static_assert(nothrow_tag_invocable<get_completion_scheduler_t,
@@ -2057,12 +2047,12 @@
     {
         try
         {
-            __self.__result_->template emplace<1>((_Us &&) __us...);
+            __self.__result_->template emplace<1>((_Us&&)__us...);
             __self.__continuation_.resume();
         }
         catch (...)
         {
-            set_error((__receiver_base &&) __self, std::current_exception());
+            set_error((__receiver_base&&)__self, std::current_exception());
         }
     }
 
@@ -2071,13 +2061,13 @@
                            _Error&& __err) noexcept
     {
         if constexpr (__decays_to<_Error, std::exception_ptr>)
-            __self.__result_->template emplace<2>((_Error &&) __err);
+            __self.__result_->template emplace<2>((_Error&&)__err);
         else if constexpr (__decays_to<_Error, std::error_code>)
             __self.__result_->template emplace<2>(
                 std::make_exception_ptr(std::system_error(__err)));
         else
             __self.__result_->template emplace<2>(
-                std::make_exception_ptr((_Error &&) __err));
+                std::make_exception_ptr((_Error&&)__err));
         __self.__continuation_.resume();
     }
 
@@ -2139,7 +2129,7 @@
                 break;
             case 1: // set_value
                 if constexpr (!std::is_void_v<_Value>)
-                    return (_Value &&) std::get<1>(__result_);
+                    return (_Value&&)std::get<1>(__result_);
                 else
                     return;
             case 2: // set_error
@@ -2163,7 +2153,7 @@
     {
         __t(_Sender&& sndr, __coro::coroutine_handle<_Promise> __hcoro) //
             noexcept(__nothrow_connectable<_Sender, __receiver>) :
-            __op_state_(connect((_Sender &&) sndr,
+            __op_state_(connect((_Sender&&)sndr,
                                 __receiver{{&this->__result_, __hcoro}}))
         {}
 
@@ -2189,7 +2179,7 @@
     requires(_Promise& __promise) {
         {
             __promise.unhandled_stopped()
-            } -> convertible_to<__coro::coroutine_handle<>>;
+        } -> convertible_to<__coro::coroutine_handle<>>;
     };
 
 struct __unspecified
@@ -2242,21 +2232,21 @@
         {
             using _Result = tag_invoke_result_t<as_awaitable_t, _Tp, _Promise&>;
             static_assert(__awaitable<_Result, _Promise>);
-            return tag_invoke(*this, (_Tp &&) __t, __promise);
+            return tag_invoke(*this, (_Tp&&)__t, __promise);
         }
         else if constexpr (__awaitable<_Tp, __unspecified>)
         { // NOT __awaitable<_Tp, _Promise> !!
-            return (_Tp &&) __t;
+            return (_Tp&&)__t;
         }
         else if constexpr (__awaitable_sender<_Tp, _Promise>)
         {
             auto __hcoro =
                 __coro::coroutine_handle<_Promise>::from_promise(__promise);
-            return __sender_awaitable_t<_Promise, _Tp>{(_Tp &&) __t, __hcoro};
+            return __sender_awaitable_t<_Promise, _Tp>{(_Tp&&)__t, __hcoro};
         }
         else
         {
-            return (_Tp &&) __t;
+            return (_Tp&&)__t;
         }
     }
 };
@@ -2281,7 +2271,7 @@
     __continuation_handle(__coro::coroutine_handle<_Promise> __coro) noexcept :
         __coro_(__coro)
     {
-        if constexpr (requires(_Promise & __promise) {
+        if constexpr (requires(_Promise& __promise) {
                           __promise.unhandled_stopped();
                       })
         {
@@ -2380,7 +2370,7 @@
         -> __call_result_t<as_awaitable_t, _Value, _Promise&>
     {
         static_assert(derived_from<_Promise, with_awaitable_senders>);
-        return as_awaitable((_Value &&) __val, static_cast<_Promise&>(*this));
+        return as_awaitable((_Value&&)__val, static_cast<_Promise&>(*this));
     }
 };
 } // namespace __with_awaitable_senders
@@ -2428,8 +2418,8 @@
             // Delete the state as cleanup:
             auto __g = __scope_guard{__self.__op_state_->__delete_,
                                      __self.__op_state_};
-            return __tag((_Receiver &&) __self.__op_state_->__rcvr_,
-                         (_As &&) __as...);
+            return __tag((_Receiver&&)__self.__op_state_->__rcvr_,
+                         (_As&&)__as...);
         }
 
         // Forward all receiever queries.
@@ -2454,12 +2444,11 @@
     template <__decays_to<_Receiver> _CvrefReceiver>
     __operation(_Sender&& __sndr, _CvrefReceiver&& __rcvr) :
         __operation_base<_ReceiverId>{
-            (_CvrefReceiver &&) __rcvr,
+            (_CvrefReceiver&&)__rcvr,
             [](__operation_base<_ReceiverId>* __self) noexcept {
-                delete static_cast<__operation*>(__self);
+        delete static_cast<__operation*>(__self);
             }},
-        __op_state_(
-            connect((_Sender &&) __sndr, __receiver_t<_ReceiverId>{this}))
+    __op_state_(connect((_Sender&&)__sndr, __receiver_t<_ReceiverId>{this}))
     {}
 };
 
@@ -2469,7 +2458,7 @@
     void operator()(_Sender&& __sndr, _Receiver __rcvr) const noexcept(false)
     {
         start((new __operation<__id<_Sender>, __id<_Receiver>>{
-                   (_Sender &&) __sndr, (_Receiver &&) __rcvr})
+                   (_Sender&&)__sndr, (_Receiver&&)__rcvr})
                   ->__op_state_);
     }
 };
@@ -2492,7 +2481,7 @@
 
         friend void tag_invoke(start_t, __op& __self) noexcept
         {
-            set_value((_Receiver &&) __self.__recv_);
+            set_value((_Receiver&&)__self.__recv_);
         }
     };
 
@@ -2507,7 +2496,7 @@
         template <typename _Receiver>
         friend __op<_Receiver> tag_invoke(connect_t, __sender, _Receiver __rcvr)
         {
-            return {{}, (_Receiver &&) __rcvr};
+            return {{}, (_Receiver&&)__rcvr};
         }
     };
 
@@ -2579,8 +2568,7 @@
     template <class _Sender, class _Env>
     void operator()(_Sender&& __sndr, _Env&& __env) const
     {
-        __submit((_Sender &&) __sndr,
-                 __detached_receiver_t<_Env>{(_Env &&) __env});
+        __submit((_Sender&&)__sndr, __detached_receiver_t<_Env>{(_Env&&)__env});
     }
 };
 
@@ -2600,7 +2588,7 @@
         // The selected implementation should return void
         static_assert(
             same_as<void, __call_result_t<_Dispatcher, _Sender, _Env>>);
-        _Dispatcher{}((_Sender &&) __sndr, (_Env &&) __env);
+        _Dispatcher{}((_Sender&&)__sndr, (_Env&&)__env);
     }
 };
 } // namespace __start_detached
@@ -2630,7 +2618,7 @@
         {
             std::apply(
                 [&__op_state](_Ts&... __ts) {
-                    _Tag{}((_Receiver &&) __op_state.__rcvr_, (_Ts &&) __ts...);
+                _Tag{}((_Receiver&&)__op_state.__rcvr_, (_Ts&&)__ts...);
                 },
                 __op_state.__vals_);
         }
@@ -2659,7 +2647,7 @@
             noexcept((std::is_nothrow_copy_constructible_v<_Ts> && ...))
                 -> __operation_t<_Receiver>
         {
-            return {{}, __sndr.__vals_, (_Receiver &&) __rcvr};
+            return {{}, __sndr.__vals_, (_Receiver&&)__rcvr};
         }
 
         template <receiver_of<completion_signatures> _Receiver>
@@ -2667,7 +2655,7 @@
             noexcept((std::is_nothrow_move_constructible_v<_Ts> && ...))
                 -> __operation_t<_Receiver>
         {
-            return {{}, ((__t &&) __sndr).__vals_, (_Receiver &&) __rcvr};
+            return {{}, ((__t&&)__sndr).__vals_, (_Receiver&&)__rcvr};
         }
 
         friend empty_env tag_invoke(get_env_t, const __t&) noexcept
@@ -2713,7 +2701,7 @@
         operator()(_Ts&&... __ts) const
         noexcept((__nothrow_constructible_from<__decay_t<_Ts>, _Ts> && ...))
     {
-        return {{{(_Ts &&) __ts...}}};
+        return {{{(_Ts&&)__ts...}}};
     }
 } just{};
 
@@ -2725,7 +2713,7 @@
         operator()(_Error&& __err) const
         noexcept(__nothrow_constructible_from<__decay_t<_Error>, _Error>)
     {
-        return {{{(_Error &&) __err}}};
+        return {{{(_Error&&)__err}}};
     }
 } just_error{};
 
@@ -2761,7 +2749,7 @@
         }
         catch (...)
         {
-            set_error((__as_receiver &&) __rcvr, std::exception_ptr());
+            set_error((__as_receiver&&)__rcvr, std::exception_ptr());
         }
     }
 
@@ -2784,11 +2772,11 @@
     template <scheduler _Scheduler, class _Fun>
         requires __callable<_Fun&> && move_constructible<_Fun>
     void operator()(_Scheduler&& __sched, _Fun __fun) const //
-        noexcept(noexcept(__submit(schedule((_Scheduler &&) __sched),
-                                   __as_receiver<_Fun>{(_Fun &&) __fun})))
+        noexcept(noexcept(__submit(schedule((_Scheduler&&)__sched),
+                                   __as_receiver<_Fun>{(_Fun&&)__fun})))
     {
-        (void)__submit(schedule((_Scheduler &&) __sched),
-                       __as_receiver<_Fun>{(_Fun &&) __fun});
+        (void)__submit(schedule((_Scheduler&&)__sched),
+                       __as_receiver<_Fun>{(_Fun&&)__fun});
     }
 
     template <scheduler _Scheduler, class _Fun>
@@ -2797,7 +2785,7 @@
     void operator()(_Scheduler&& __sched, _Fun __fun) const
         noexcept(nothrow_tag_invocable<execute_t, _Scheduler, _Fun>)
     {
-        (void)tag_invoke(execute_t{}, (_Scheduler &&) __sched, (_Fun &&) __fun);
+        (void)tag_invoke(execute_t{}, (_Scheduler&&)__sched, (_Fun&&)__fun);
     }
 };
 } // namespace __execute_
@@ -2840,7 +2828,7 @@
     __call_result_t<_T1, __call_result_t<_T0, _Sender>>
         operator()(_Sender&& __sndr) &&
     {
-        return ((_T1 &&) __t1_)(((_T0 &&) __t0_)((_Sender &&) __sndr));
+        return ((_T1&&)__t1_)(((_T0&&)__t0_)((_Sender&&)__sndr));
     }
 
     template <sender _Sender>
@@ -2849,7 +2837,7 @@
     __call_result_t<_T1, __call_result_t<_T0, _Sender>>
         operator()(_Sender&& __sndr) const&
     {
-        return __t1_(__t0_((_Sender &&) __sndr));
+        return __t1_(__t0_((_Sender&&)__sndr));
     }
 };
 
@@ -2861,13 +2849,13 @@
 __call_result_t<_Closure, _Sender> operator|(_Sender&& __sndr,
                                              _Closure&& __clsur)
 {
-    return ((_Closure &&) __clsur)((_Sender &&) __sndr);
+    return ((_Closure&&)__clsur)((_Sender&&)__sndr);
 }
 
 template <__sender_adaptor_closure _T0, __sender_adaptor_closure _T1>
 __compose<__decay_t<_T0>, __decay_t<_T1>> operator|(_T0&& __t0, _T1&& __t1)
 {
-    return {{}, (_T0 &&) __t0, (_T1 &&) __t1};
+    return {{}, (_T0&&)__t0, (_T1&&)__t1};
 }
 
 template <class _Fun, class... _As>
@@ -2883,8 +2871,7 @@
     {
         return std::apply(
             [&__sndr, this](_As&... __as) {
-                return ((_Fun &&) __fun_)((_Sender &&) __sndr,
-                                          (_As &&) __as...);
+            return ((_Fun&&)__fun_)((_Sender&&)__sndr, (_As&&)__as...);
             },
             __as_);
     }
@@ -2897,7 +2884,7 @@
     {
         return std::apply(
             [&__sndr, this](const _As&... __as) {
-                return __fun_((_Sender &&) __sndr, __as...);
+            return __fun_((_Sender&&)__sndr, __as...);
             },
             __as_);
     }
@@ -2918,7 +2905,7 @@
 {
     static_assert(std::is_reference_v<__copy_cvref_t<_Up&&, _Tp>>);
     static_assert(std::is_base_of_v<_Tp, __decay_t<_Up>>);
-    return (__copy_cvref_t<_Up&&, _Tp>)(_Up &&) u;
+    return (__copy_cvref_t<_Up&&, _Tp>)(_Up&&)u;
 }
 
 namespace __no
@@ -2943,7 +2930,7 @@
     {
         template <class _T1>
             requires constructible_from<_Base, _T1>
-        explicit __t(_T1&& __base) : __base_((_T1 &&) __base)
+        explicit __t(_T1&& __base) : __base_((_T1&&)__base)
         {}
 
       private:
@@ -2968,7 +2955,7 @@
             _Base&&
             base() && noexcept
         {
-            return (_Base &&) __base_;
+            return (_Base&&)__base_;
         }
     };
 };
@@ -2990,10 +2977,10 @@
     template <class _Self, class... _Ts>                                       \
     STDEXEC_DETAIL_CUDACC_HOST_DEVICE static auto                              \
         __call_##_TAG(_Self&& __self, _Ts&&... __ts) noexcept(                 \
-            noexcept(((_Self &&) __self)._TAG((_Ts &&) __ts...)))              \
-            ->decltype(((_Self &&) __self)._TAG((_Ts &&) __ts...))             \
+            noexcept(((_Self&&)__self)._TAG((_Ts&&)__ts...)))                  \
+            ->decltype(((_Self&&)__self)._TAG((_Ts&&)__ts...))                 \
     {                                                                          \
-        return ((_Self &&) __self)._TAG((_Ts &&) __ts...);                     \
+        return ((_Self&&)__self)._TAG((_Ts&&)__ts...);                         \
     } /**/
 #define _CALL_MEMBER(_TAG, ...) __call_##_TAG(__VA_ARGS__)
 
@@ -3043,11 +3030,11 @@
         {
             if constexpr (__has_base)
             {
-                return __c_cast<__t>((_Dp &&) __self).base();
+                return __c_cast<__t>((_Dp&&)__self).base();
             }
             else
             {
-                return ((_Dp &&) __self).base();
+                return ((_Dp&&)__self).base();
             }
         }
 
@@ -3055,12 +3042,12 @@
         STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
             friend auto
             tag_invoke(_SetValue, _Derived&& __self, _As&&... __as) noexcept
-            -> decltype(_CALL_MEMBER(set_value, (_Derived &&) __self,
-                                     (_As &&) __as...))
+            -> decltype(_CALL_MEMBER(set_value, (_Derived&&)__self,
+                                     (_As&&)__as...))
         {
-            static_assert(noexcept(_CALL_MEMBER(set_value, (_Derived &&) __self,
-                                                (_As &&) __as...)));
-            _CALL_MEMBER(set_value, (_Derived &&) __self, (_As &&) __as...);
+            static_assert(noexcept(
+                _CALL_MEMBER(set_value, (_Derived&&)__self, (_As&&)__as...)));
+            _CALL_MEMBER(set_value, (_Derived&&)__self, (_As&&)__as...);
         }
 
         template <same_as<set_value_t> _SetValue, class _Dp = _Derived,
@@ -3071,19 +3058,19 @@
             friend void tag_invoke(_SetValue, _Derived&& __self,
                                    _As&&... __as) noexcept
         {
-            stdexec::set_value(__get_base((_Dp &&) __self), (_As &&) __as...);
+            stdexec::set_value(__get_base((_Dp&&)__self), (_As&&)__as...);
         }
 
         template <same_as<set_error_t> _SetError, class _Error>
         STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
             friend auto
             tag_invoke(_SetError, _Derived&& __self, _Error&& __err) noexcept
-            -> decltype(_CALL_MEMBER(set_error, (_Derived &&) __self,
-                                     (_Error &&) __err))
+            -> decltype(_CALL_MEMBER(set_error, (_Derived&&)__self,
+                                     (_Error&&)__err))
         {
-            static_assert(noexcept(_CALL_MEMBER(set_error, (_Derived &&) __self,
-                                                (_Error &&) __err)));
-            _CALL_MEMBER(set_error, (_Derived &&) __self, (_Error &&) __err);
+            static_assert(noexcept(
+                _CALL_MEMBER(set_error, (_Derived&&)__self, (_Error&&)__err)));
+            _CALL_MEMBER(set_error, (_Derived&&)__self, (_Error&&)__err);
         }
 
         template <same_as<set_error_t> _SetError, class _Error,
@@ -3094,19 +3081,18 @@
             friend void tag_invoke(_SetError, _Derived&& __self,
                                    _Error&& __err) noexcept
         {
-            stdexec::set_error(__get_base((_Derived &&) __self),
-                               (_Error &&) __err);
+            stdexec::set_error(__get_base((_Derived&&)__self), (_Error&&)__err);
         }
 
         template <same_as<set_stopped_t> _SetStopped, class _Dp = _Derived>
         STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
             friend auto
             tag_invoke(_SetStopped, _Derived&& __self) noexcept
-            -> decltype(_CALL_MEMBER(set_stopped, (_Dp &&) __self))
+            -> decltype(_CALL_MEMBER(set_stopped, (_Dp&&)__self))
         {
             static_assert(
-                noexcept(_CALL_MEMBER(set_stopped, (_Derived &&) __self)));
-            _CALL_MEMBER(set_stopped, (_Derived &&) __self);
+                noexcept(_CALL_MEMBER(set_stopped, (_Derived&&)__self)));
+            _CALL_MEMBER(set_stopped, (_Derived&&)__self);
         }
 
         template <same_as<set_stopped_t> _SetStopped, class _Dp = _Derived>
@@ -3115,7 +3101,7 @@
         STDEXEC_DETAIL_CUDACC_HOST_DEVICE //
             friend void tag_invoke(_SetStopped, _Derived&& __self) noexcept
         {
-            stdexec::set_stopped(__get_base((_Derived &&) __self));
+            stdexec::set_stopped(__get_base((_Derived&&)__self));
         }
 
         // Pass through the get_env receiver query
@@ -3166,13 +3152,13 @@
 {
     if constexpr (same_as<void, std::invoke_result_t<_Fun, _As...>>)
     {
-        std::invoke((_Fun &&) __fun, (_As &&) __as...);
-        set_value((_Receiver &&) __rcvr);
+        std::invoke((_Fun&&)__fun, (_As&&)__as...);
+        set_value((_Receiver&&)__rcvr);
     }
     else
     {
-        set_value((_Receiver &&) __rcvr,
-                  std::invoke((_Fun &&) __fun, (_As &&) __as...));
+        set_value((_Receiver&&)__rcvr,
+                  std::invoke((_Fun&&)__fun, (_As&&)__as...));
     }
 }
 
@@ -3182,19 +3168,19 @@
 {
     if constexpr (__nothrow_invocable<_Fun, _As...>)
     {
-        stdexec::__set_value_invoke_((_Receiver &&) __rcvr, (_Fun &&) __fun,
-                                     (_As &&) __as...);
+        stdexec::__set_value_invoke_((_Receiver&&)__rcvr, (_Fun&&)__fun,
+                                     (_As&&)__as...);
     }
     else
     {
         try
         {
-            stdexec::__set_value_invoke_((_Receiver &&) __rcvr, (_Fun &&) __fun,
-                                         (_As &&) __as...);
+            stdexec::__set_value_invoke_((_Receiver&&)__rcvr, (_Fun&&)__fun,
+                                         (_As&&)__as...);
         }
         catch (...)
         {
-            set_error((_Receiver &&) __rcvr, std::current_exception());
+            set_error((_Receiver&&)__rcvr, std::current_exception());
         }
     }
 }
@@ -3243,16 +3229,16 @@
                      __receiver_of_invoke_result<_Receiver, _Fun, _As...>
         friend void tag_invoke(_Tag, __t&& __self, _As&&... __as) noexcept
         {
-            stdexec::__set_value_invoke((_Receiver &&) __self.__op_->__rcvr_,
-                                        (_Fun &&) __self.__op_->__fun_,
-                                        (_As &&) __as...);
+            stdexec::__set_value_invoke((_Receiver&&)__self.__op_->__rcvr_,
+                                        (_Fun&&)__self.__op_->__fun_,
+                                        (_As&&)__as...);
         }
 
         template <__one_of<set_error_t, set_stopped_t> _Tag, class... _As>
             requires __callable<_Tag, _Receiver, _As...>
         friend void tag_invoke(_Tag __tag, __t&& __self, _As&&... __as) noexcept
         {
-            __tag((_Receiver &&) __self.__op_->__rcvr_, (_As &&) __as...);
+            __tag((_Receiver&&)__self.__op_->__rcvr_, (_As&&)__as...);
         }
 
         friend auto tag_invoke(get_env_t, const __t& __self)
@@ -3280,8 +3266,8 @@
             noexcept(__nothrow_decay_copyable<_Receiver>    //
                          && __nothrow_decay_copyable<_Fun>  //
                              && __nothrow_connectable<_Sender, __receiver_t>) :
-            __data_{(_Receiver &&) __rcvr, (_Fun &&) __fun},
-            __op_(connect((_Sender &&) __sndr, __receiver_t{&__data_}))
+            __data_{(_Receiver&&)__rcvr, (_Fun&&)__fun},
+            __op_(connect((_Sender&&)__sndr, __receiver_t{&__data_}))
         {}
 
         friend void tag_invoke(start_t, __t& __self) noexcept
@@ -3327,8 +3313,8 @@
                      __copy_cvref_t<_Self, _Fun>>)
                 -> __operation<_Self, _Receiver>
         {
-            return {((_Self &&) __self).__sndr_, (_Receiver &&) __rcvr,
-                    ((_Self &&) __self).__fun_};
+            return {((_Self&&)__self).__sndr_, (_Receiver&&)__rcvr,
+                    ((_Self&&)__self).__fun_};
         }
 
         template <__decays_to<__t> _Self, class _Env>
@@ -3361,7 +3347,7 @@
                 sender<__sender<_Sender, _Fun>>
     __sender<_Sender, _Fun> operator()(_Sender&& __sndr, _Fun __fun) const
     {
-        return __sender<_Sender, _Fun>{(_Sender &&) __sndr, (_Fun &&) __fun};
+        return __sender<_Sender, _Fun>{(_Sender&&)__sndr, (_Fun&&)__fun};
     }
 
     template <sender _Sender, __movable_value _Fun>
@@ -3373,8 +3359,8 @@
                  _Sender, _Fun>)
     {
         auto __sched = get_completion_scheduler<set_value_t>(get_env(__sndr));
-        return tag_invoke(then_t{}, std::move(__sched), (_Sender &&) __sndr,
-                          (_Fun &&) __fun);
+        return tag_invoke(then_t{}, std::move(__sched), (_Sender&&)__sndr,
+                          (_Fun&&)__fun);
     }
 
     template <sender _Sender, __movable_value _Fun>
@@ -3384,13 +3370,13 @@
     sender auto operator()(_Sender&& __sndr, _Fun __fun) const
         noexcept(nothrow_tag_invocable<then_t, _Sender, _Fun>)
     {
-        return tag_invoke(then_t{}, (_Sender &&) __sndr, (_Fun &&) __fun);
+        return tag_invoke(then_t{}, (_Sender&&)__sndr, (_Fun&&)__fun);
     }
 
     template <class _Fun>
     __binder_back<then_t, _Fun> operator()(_Fun __fun) const
     {
-        return {{}, {}, {(_Fun &&) __fun}};
+        return {{}, {}, {(_Fun&&)__fun}};
     }
 };
 } // namespace __then
@@ -3419,7 +3405,7 @@
         friend void tag_invoke(set_value_t, _Self&& __self,
                                _Args&&... __args) noexcept
         {
-            set_value((_Receiver &&) __self.__rcvr_, (_Args &&) __args...);
+            set_value((_Receiver&&)__self.__rcvr_, (_Args&&)__args...);
         }
 
         // Customize set_error by invoking the invocable and passing the result
@@ -3430,15 +3416,15 @@
         friend void tag_invoke(set_error_t, _Self&& __self,
                                _Error&& __error) noexcept
         {
-            stdexec::__set_value_invoke((_Receiver &&) __self.__rcvr_,
-                                        (_Fun &&) __self.__fun_,
-                                        (_Error &&) __error);
+            stdexec::__set_value_invoke((_Receiver&&)__self.__rcvr_,
+                                        (_Fun&&)__self.__fun_,
+                                        (_Error&&)__error);
         }
 
         friend void tag_invoke(set_stopped_t, __t&& __self) noexcept
             requires __callable<set_stopped_t, _Receiver>
         {
-            set_stopped((_Receiver &&) __self.__rcvr_);
+            set_stopped((_Receiver&&)__self.__rcvr_);
         }
 
         friend env_of_t<_Receiver> tag_invoke(get_env_t,
@@ -3484,9 +3470,9 @@
                                     __receiver<_Receiver>>
         {
             return stdexec::connect(
-                ((_Self &&) __self).__sndr_,
-                __receiver<_Receiver>{(_Receiver &&) __rcvr,
-                                      ((_Self &&) __self).__fun_});
+                ((_Self&&)__self).__sndr_,
+                __receiver<_Receiver>{(_Receiver&&)__rcvr,
+                                      ((_Self&&)__self).__fun_});
         }
 
         template <__decays_to<__t> _Self, class _Env>
@@ -3521,8 +3507,8 @@
     {
         auto __sched = get_completion_scheduler<set_error_t>(
             get_env(__sndr)); // TODO ADD TEST!
-        return tag_invoke(upon_error_t{}, std::move(__sched),
-                          (_Sender &&) __sndr, (_Fun &&) __fun);
+        return tag_invoke(upon_error_t{}, std::move(__sched), (_Sender&&)__sndr,
+                          (_Fun&&)__fun);
     }
 
     template <sender _Sender, __movable_value _Fun>
@@ -3532,7 +3518,7 @@
     sender auto operator()(_Sender&& __sndr, _Fun __fun) const
         noexcept(nothrow_tag_invocable<upon_error_t, _Sender, _Fun>)
     {
-        return tag_invoke(upon_error_t{}, (_Sender &&) __sndr, (_Fun &&) __fun);
+        return tag_invoke(upon_error_t{}, (_Sender&&)__sndr, (_Fun&&)__fun);
     }
 
     template <sender _Sender, __movable_value _Fun>
@@ -3542,13 +3528,13 @@
                 sender<__sender<_Sender, _Fun>>
     __sender<_Sender, _Fun> operator()(_Sender&& __sndr, _Fun __fun) const
     {
-        return __sender<_Sender, _Fun>{(_Sender &&) __sndr, (_Fun &&) __fun};
+        return __sender<_Sender, _Fun>{(_Sender&&)__sndr, (_Fun&&)__fun};
     }
 
     template <class _Fun>
     __binder_back<upon_error_t, _Fun> operator()(_Fun __fun) const
     {
-        return {{}, {}, {(_Fun &&) __fun}};
+        return {{}, {}, {(_Fun&&)__fun}};
     }
 };
 } // namespace __upon_error
@@ -3576,7 +3562,7 @@
         friend void tag_invoke(set_value_t, _Self&& __self,
                                _Args&&... __args) noexcept
         {
-            set_value((_Receiver &&) __self.__rcvr_, (_Args &&) __args...);
+            set_value((_Receiver&&)__self.__rcvr_, (_Args&&)__args...);
         }
 
         template <__decays_to<__t> _Self, class _Error>
@@ -3584,13 +3570,13 @@
         friend void tag_invoke(set_error_t, _Self&& __self,
                                _Error&& __error) noexcept
         {
-            set_error((_Receiver &&) __self.__rcvr_, (_Error &&) __error);
+            set_error((_Receiver&&)__self.__rcvr_, (_Error&&)__error);
         }
 
         friend void tag_invoke(set_stopped_t, __t&& __self) noexcept
         {
-            stdexec::__set_value_invoke((_Receiver &&) __self.__rcvr_,
-                                        (_Fun &&) __self.__fun_);
+            stdexec::__set_value_invoke((_Receiver&&)__self.__rcvr_,
+                                        (_Fun&&)__self.__fun_);
         }
 
         friend env_of_t<_Receiver> tag_invoke(get_env_t,
@@ -3631,17 +3617,16 @@
             requires __receiver_of_invoke_result<_Receiver, _Fun> &&
                      sender_to<__copy_cvref_t<_Self, _Sender>,
                                __receiver<_Receiver>>
-                     friend auto tag_invoke(connect_t, _Self&& __self,
-                                            _Receiver __rcvr) //
-                     noexcept(
-                         __nothrow_connectable<_Sender, __receiver<_Receiver>>)
-                         -> connect_result_t<__copy_cvref_t<_Self, _Sender>,
-                                             __receiver<_Receiver>>
+        friend auto tag_invoke(connect_t, _Self&& __self,
+                               _Receiver __rcvr) //
+            noexcept(__nothrow_connectable<_Sender, __receiver<_Receiver>>)
+                -> connect_result_t<__copy_cvref_t<_Self, _Sender>,
+                                    __receiver<_Receiver>>
         {
             return stdexec::connect(
-                ((_Self &&) __self).__sndr_,
-                __receiver<_Receiver>{(_Receiver &&) __rcvr,
-                                      ((_Self &&) __self).__fun_});
+                ((_Self&&)__self).__sndr_,
+                __receiver<_Receiver>{(_Receiver&&)__rcvr,
+                                      ((_Self&&)__self).__fun_});
         }
 
         template <__decays_to<__t> _Self, class _Env>
@@ -3678,7 +3663,7 @@
         auto __sched = get_completion_scheduler<set_stopped_t>(
             get_env(__sndr)); // TODO ADD TEST!
         return tag_invoke(upon_stopped_t{}, std::move(__sched),
-                          (_Sender &&) __sndr, (_Fun &&) __fun);
+                          (_Sender&&)__sndr, (_Fun&&)__fun);
     }
 
     template <sender _Sender, __movable_value _Fun>
@@ -3688,8 +3673,7 @@
     sender auto operator()(_Sender&& __sndr, _Fun __fun) const
         noexcept(nothrow_tag_invocable<upon_stopped_t, _Sender, _Fun>)
     {
-        return tag_invoke(upon_stopped_t{}, (_Sender &&) __sndr,
-                          (_Fun &&) __fun);
+        return tag_invoke(upon_stopped_t{}, (_Sender&&)__sndr, (_Fun&&)__fun);
     }
 
     template <sender _Sender, __movable_value _Fun>
@@ -3699,13 +3683,13 @@
                 __callable<_Fun> && sender<__sender<_Sender, _Fun>>
     __sender<_Sender, _Fun> operator()(_Sender&& __sndr, _Fun __fun) const
     {
-        return __sender<_Sender, _Fun>{(_Sender &&) __sndr, (_Fun &&) __fun};
+        return __sender<_Sender, _Fun>{(_Sender&&)__sndr, (_Fun&&)__fun};
     }
 
     template <__callable _Fun>
     __binder_back<upon_stopped_t, _Fun> operator()(_Fun __fun) const
     {
-        return {{}, {}, {(_Fun &&) __fun}};
+        return {{}, {}, {(_Fun&&)__fun}};
     }
 };
 } // namespace __upon_stopped
@@ -3737,7 +3721,7 @@
             {
                 __f_(__i, __as...);
             }
-            stdexec::set_value(std::move(this->base()), (_As &&) __as...);
+            stdexec::set_value(std::move(this->base()), (_As&&)__as...);
         }
 
         template <class... _As>
@@ -3750,7 +3734,7 @@
                 {
                     __f_(__i, __as...);
                 }
-                stdexec::set_value(std::move(this->base()), (_As &&) __as...);
+                stdexec::set_value(std::move(this->base()), (_As&&)__as...);
             }
             catch (...)
             {
@@ -3763,8 +3747,8 @@
         using __id = __receiver;
 
         explicit __t(_Receiver __rcvr, _Shape __shape, _Fun __fun) :
-            receiver_adaptor<__t, _Receiver>((_Receiver &&) __rcvr),
-            __shape_(__shape), __f_((_Fun &&) __fun)
+            receiver_adaptor<__t, _Receiver>((_Receiver&&)__rcvr),
+            __shape_(__shape), __f_((_Fun&&)__fun)
         {}
     };
 };
@@ -3816,9 +3800,9 @@
                                     __receiver<_Receiver>>
         {
             return stdexec::connect(
-                ((_Self &&) __self).__sndr_,
-                __receiver<_Receiver>{(_Receiver &&) __rcvr, __self.__shape_,
-                                      ((_Self &&) __self).__fun_});
+                ((_Self&&)__self).__sndr_,
+                __receiver<_Receiver>{(_Receiver&&)__rcvr, __self.__shape_,
+                                      ((_Self&&)__self).__fun_});
         }
 
         template <__decays_to<__t> _Self, class _Env>
@@ -3854,8 +3838,8 @@
                  _Sender, _Shape, _Fun>)
     {
         auto __sched = get_completion_scheduler<set_value_t>(get_env(__sndr));
-        return tag_invoke(bulk_t{}, std::move(__sched), (_Sender &&) __sndr,
-                          (_Shape &&) __shape, (_Fun &&) __fun);
+        return tag_invoke(bulk_t{}, std::move(__sched), (_Sender&&)__sndr,
+                          (_Shape&&)__shape, (_Fun&&)__fun);
     }
 
     template <sender _Sender, integral _Shape, __movable_value _Fun>
@@ -3865,8 +3849,8 @@
     sender auto operator()(_Sender&& __sndr, _Shape __shape, _Fun __fun) const
         noexcept(nothrow_tag_invocable<bulk_t, _Sender, _Shape, _Fun>)
     {
-        return tag_invoke(bulk_t{}, (_Sender &&) __sndr, (_Shape &&) __shape,
-                          (_Fun &&) __fun);
+        return tag_invoke(bulk_t{}, (_Sender&&)__sndr, (_Shape&&)__shape,
+                          (_Fun&&)__fun);
     }
 
     template <sender _Sender, integral _Shape, __movable_value _Fun>
@@ -3876,15 +3860,15 @@
     __sender<_Sender, _Shape, _Fun> operator()(_Sender&& __sndr, _Shape __shape,
                                                _Fun __fun) const
     {
-        return __sender<_Sender, _Shape, _Fun>{(_Sender &&) __sndr, __shape,
-                                               (_Fun &&) __fun};
+        return __sender<_Sender, _Shape, _Fun>{(_Sender&&)__sndr, __shape,
+                                               (_Fun&&)__fun};
     }
 
     template <integral _Shape, class _Fun>
     __binder_back<bulk_t, _Shape, _Fun> operator()(_Shape __shape,
                                                    _Fun __fun) const
     {
-        return {{}, {}, {(_Shape &&) __shape, (_Fun &&) __fun}};
+        return {{}, {}, {(_Shape&&)__shape, (_Fun&&)__fun}};
     }
 };
 } // namespace __bulk
@@ -3928,7 +3912,7 @@
             {
                 using __tuple_t = __decayed_tuple<_Tag, _As...>;
                 __state.__data_.template emplace<__tuple_t>(__tag,
-                                                            (_As &&) __as...);
+                                                            (_As&&)__as...);
             }
             catch (...)
             {
@@ -3972,7 +3956,7 @@
         using __id = __sh_state;
 
         template <class... _Ts>
-        using __bind_tuples = //
+        using __bind_tuples =                          //
             __mbind_front_q<__variant,
                             std::tuple<set_stopped_t>, // Initial state of the
                                                        // variant is set_stopped
@@ -3999,10 +3983,10 @@
         connect_result_t<_CvrefSender, __receiver_> __op_state2_;
 
         explicit __t(_CvrefSender&& __sndr, _Env __env) :
-            __env_(__make_env(
-                (_Env &&) __env,
-                __with_(get_stop_token, __stop_source_.get_token()))),
-            __op_state2_(connect((_CvrefSender &&) __sndr, __receiver_{*this}))
+            __env_(
+                __make_env((_Env&&)__env, __with_(get_stop_token,
+                                                  __stop_source_.get_token()))),
+            __op_state2_(connect((_CvrefSender&&)__sndr, __receiver_{*this}))
         {}
 
         void __notify() noexcept
@@ -4060,7 +4044,7 @@
                 __shared_state) //
             noexcept(std::is_nothrow_move_constructible_v<_Receiver>) :
             __operation_base{nullptr, __notify},
-            __recvr_((_Receiver &&) __rcvr),
+            __recvr_((_Receiver&&)__rcvr),
             __shared_state_(std::move(__shared_state))
         {}
 
@@ -4076,7 +4060,7 @@
                     std::apply(
                         [&](auto __tag,
                             const auto&... __args) noexcept -> void {
-                            __tag((_Receiver &&) __op->__recvr_, __args...);
+                            __tag((_Receiver&&)__op->__recvr_, __args...);
                         },
                         __tupl);
                 },
@@ -4146,7 +4130,7 @@
 
         explicit __t(_CvrefSender&& __sndr, _Env __env) :
             __shared_state_{std::make_shared<__sh_state_>(
-                (_CvrefSender &&) __sndr, (_Env &&) __env)}
+                (_CvrefSender&&)__sndr, (_Env&&)__env)}
         {}
 
       private:
@@ -4179,7 +4163,7 @@
             noexcept(std::is_nothrow_move_constructible_v<_Receiver>)
                 -> __operation<_Receiver>
         {
-            return __operation<_Receiver>{(_Receiver &&) __recvr,
+            return __operation<_Receiver>{(_Receiver&&)__recvr,
                                           __self.__shared_state_};
         }
 
@@ -4228,14 +4212,12 @@
         requires(sender_in<_Sender, _Env> &&
                  __decay_copyable<env_of_t<_Sender>>) ||
                 __is_split_customized<_Sender, _Env>
-                auto operator()(_Sender&& __sndr, _Env&& __env = _Env{}) const
-                noexcept(__nothrow_callable<__dispatcher_for<_Sender, _Env>,
-                                            _Sender, _Env>)
-                    -> __call_result_t<__dispatcher_for<_Sender, _Env>, _Sender,
-                                       _Env>
+    auto operator()(_Sender&& __sndr, _Env&& __env = _Env{}) const noexcept(
+        __nothrow_callable<__dispatcher_for<_Sender, _Env>, _Sender, _Env>)
+        -> __call_result_t<__dispatcher_for<_Sender, _Env>, _Sender, _Env>
     {
-        return __dispatcher_for<_Sender, _Env>{}((_Sender &&) __sndr,
-                                                 (_Env &&) __env);
+        return __dispatcher_for<_Sender, _Env>{}((_Sender&&)__sndr,
+                                                 (_Env&&)__env);
     }
 
     __binder_back<split_t> operator()() const
@@ -4290,7 +4272,7 @@
             {
                 using __tuple_t = __decayed_tuple<_Tag, _As...>;
                 __state.__data_.template emplace<__tuple_t>(__tag,
-                                                            (_As &&) __as...);
+                                                            (_As&&)__as...);
             }
             catch (...)
             {
@@ -4328,7 +4310,7 @@
         using __id = __sh_state;
 
         template <class... _Ts>
-        using __bind_tuples = //
+        using __bind_tuples =                          //
             __mbind_front_q<__variant,
                             std::tuple<set_stopped_t>, // Initial state of the
                                                        // variant is set_stopped
@@ -4356,9 +4338,9 @@
         connect_result_t<_Sender&, __receiver_t> __op_state2_;
 
         explicit __t(_Sender& __sndr, _Env __env) :
-            __env_(__make_env(
-                (_Env &&) __env,
-                __with_(get_stop_token, __stop_source_.get_token()))),
+            __env_(
+                __make_env((_Env&&)__env, __with_(get_stop_token,
+                                                  __stop_source_.get_token()))),
             __op_state2_(connect(__sndr, __receiver_t{*this}))
         {
             start(__op_state2_);
@@ -4414,13 +4396,13 @@
       public:
         using __id = __operation;
 
-        __t(                  //
-            _Receiver __rcvr, //
+        __t(                    //
+            _Receiver __rcvr,   //
             __intrusive_ptr<stdexec::__t<__sh_state<_SenderId, _EnvId>>>
                 __shared_state) //
             noexcept(std::is_nothrow_move_constructible_v<_Receiver>) :
             __operation_base{__notify},
-            __rcvr_((_Receiver &&) __rcvr),
+            __rcvr_((_Receiver&&)__rcvr),
             __shared_state_(std::move(__shared_state))
         {}
 
@@ -4446,7 +4428,7 @@
                 [&](auto& __tupl) noexcept -> void {
                     std::apply(
                         [&](auto __tag, auto&... __args) noexcept -> void {
-                            __tag((_Receiver &&) __op->__rcvr_,
+                            __tag((_Receiver&&)__op->__rcvr_,
                                   std::move(__args)...);
                         },
                         __tupl);
@@ -4476,7 +4458,7 @@
                 {
                     // Stop has already been requested. Don't bother starting
                     // the child operations.
-                    stdexec::set_stopped((_Receiver &&) __self.__rcvr_);
+                    stdexec::set_stopped((_Receiver&&)__self.__rcvr_);
                 }
                 else
                 {
@@ -4511,9 +4493,9 @@
         using is_sender = void;
 
         explicit __t(_Sender __sndr, _Env __env) :
-            __sndr_((_Sender &&) __sndr), __shared_state_{
-                                              __make_intrusive<__sh_state_>(
-                                                  __sndr_, (_Env &&) __env)}
+            __sndr_((_Sender&&)__sndr),
+            __shared_state_{
+                __make_intrusive<__sh_state_>(__sndr_, (_Env&&)__env)}
         {}
 
         ~__t()
@@ -4560,7 +4542,7 @@
             noexcept(std::is_nothrow_move_constructible_v<_Receiver>)
                 -> __operation<_Receiver>
         {
-            return __operation<_Receiver>{(_Receiver &&) __rcvr,
+            return __operation<_Receiver>{(_Receiver&&)__rcvr,
                                           std::move(__self).__shared_state_};
         }
 
@@ -4623,14 +4605,12 @@
         requires(copy_constructible<__decay_t<_Sender>> &&
                  sender_to<_Sender&, __receiver_t<_Sender, _Env>>) ||
                 __is_ensure_started_customized<_Sender, _Env>
-                auto operator()(_Sender&& __sndr, _Env&& __env = _Env{}) const
-                noexcept(__nothrow_callable<__dispatcher_for<_Sender, _Env>,
-                                            _Sender, _Env>)
-                    -> __call_result_t<__dispatcher_for<_Sender, _Env>, _Sender,
-                                       _Env>
+    auto operator()(_Sender&& __sndr, _Env&& __env = _Env{}) const noexcept(
+        __nothrow_callable<__dispatcher_for<_Sender, _Env>, _Sender, _Env>)
+        -> __call_result_t<__dispatcher_for<_Sender, _Env>, _Sender, _Env>
     {
-        return __dispatcher_for<_Sender, _Env>{}((_Sender &&) __sndr,
-                                                 (_Env &&) __env);
+        return __dispatcher_for<_Sender, _Env>{}((_Sender&&)__sndr,
+                                                 (_Env&&)__env);
     }
 
     template <__ensure_started_sender _Sender>
@@ -4732,16 +4712,15 @@
                     __minvoke<__op_state_for<_Receiver, _Fun>, _As...>;
                 auto& __args =
                     __self.__op_state_->__args_.template emplace<__tuple_t>(
-                        (_As &&) __as...);
-                auto& __op =
-                    __self.__op_state_->__op_state3_
-                        .template emplace<__op_state_t>(__conv{[&] {
-                            return connect(
-                                std::apply(
-                                    std::move(__self.__op_state_->__fun_),
-                                    __args),
-                                std::move(__self.__op_state_->__rcvr_));
-                        }});
+                        (_As&&)__as...);
+                auto& __op = __self.__op_state_->__op_state3_
+                                 .template emplace<__op_state_t>(__conv{
+                                     [&] {
+                    return connect(
+                        std::apply(std::move(__self.__op_state_->__fun_),
+                                   __args),
+                        std::move(__self.__op_state_->__rcvr_));
+                                 }});
                 start(__op);
             }
             catch (...)
@@ -4757,7 +4736,7 @@
                      __callable<_Tag, _Receiver, _As...>
         friend void tag_invoke(_Tag __tag, __t&& __self, _As&&... __as) noexcept
         {
-            __tag(std::move(__self.__op_state_->__rcvr_), (_As &&) __as...);
+            __tag(std::move(__self.__op_state_->__rcvr_), (_As&&)__as...);
         }
 
         friend auto tag_invoke(get_env_t, const __t& __self)
@@ -4803,8 +4782,8 @@
 
         template <class _Receiver2>
         __t(_Sender&& __sndr, _Receiver2&& __rcvr, _Fun __fun) :
-            __op_base_t{{}, (_Receiver2 &&) __rcvr, (_Fun &&) __fun},
-            __op_state2_(connect((_Sender &&) __sndr, __receiver_t{this}))
+            __op_base_t{{}, (_Receiver2&&)__rcvr, (_Fun&&)__fun},
+            __op_state2_(connect((_Sender&&)__sndr, __receiver_t{this}))
         {}
 
         connect_result_t<_Sender, __receiver_t> __op_state2_;
@@ -4843,9 +4822,9 @@
         friend auto tag_invoke(connect_t, _Self&& __self, _Receiver __rcvr)
             -> __operation_t<_Self, _Receiver>
         {
-            return __operation_t<_Self, _Receiver>{((_Self &&) __self).__sndr_,
-                                                   (_Receiver &&) __rcvr,
-                                                   ((_Self &&) __self).__fun_};
+            return __operation_t<_Self, _Receiver>{((_Self&&)__self).__sndr_,
+                                                   (_Receiver&&)__rcvr,
+                                                   ((_Self&&)__self).__fun_};
         }
 
         friend auto tag_invoke(get_env_t, const __t& __self) //
@@ -4885,8 +4864,8 @@
                  _Sender, _Fun>)
     {
         auto __sched = get_completion_scheduler<set_value_t>(get_env(__sndr));
-        return tag_invoke(_LetTag{}, std::move(__sched), (_Sender &&) __sndr,
-                          (_Fun &&) __fun);
+        return tag_invoke(_LetTag{}, std::move(__sched), (_Sender&&)__sndr,
+                          (_Fun&&)__fun);
     }
 
     template <sender _Sender, __movable_value _Fun>
@@ -4896,7 +4875,7 @@
     sender auto operator()(_Sender&& __sndr, _Fun __fun) const
         noexcept(nothrow_tag_invocable<_LetTag, _Sender, _Fun>)
     {
-        return tag_invoke(_LetTag{}, (_Sender &&) __sndr, (_Fun &&) __fun);
+        return tag_invoke(_LetTag{}, (_Sender&&)__sndr, (_Fun&&)__fun);
     }
 
     template <sender _Sender, __movable_value _Fun>
@@ -4906,13 +4885,13 @@
                 sender<__sender<_Sender, _Fun>>
     __sender<_Sender, _Fun> operator()(_Sender&& __sndr, _Fun __fun) const
     {
-        return __sender<_Sender, _Fun>{(_Sender &&) __sndr, (_Fun &&) __fun};
+        return __sender<_Sender, _Fun>{(_Sender&&)__sndr, (_Fun&&)__fun};
     }
 
     template <class _Fun>
     __binder_back<_LetTag, _Fun> operator()(_Fun __fun) const
     {
-        return {{}, {}, {(_Fun &&) __fun}};
+        return {{}, {}, {(_Fun&&)__fun}};
     }
 };
 
@@ -4953,7 +4932,7 @@
 
         _Receiver&& base() && noexcept
         {
-            return (_Receiver &&) __op_->__rcvr_;
+            return (_Receiver&&)__op_->__rcvr_;
         }
 
         const _Receiver& base() const& noexcept
@@ -4969,12 +4948,12 @@
                 using _Value =
                     __single_sender_value_t<_Sender, env_of_t<_Receiver>>;
                 static_assert(constructible_from<_Value, _Ty>);
-                stdexec::set_value(((__t &&) * this).base(),
-                                   std::optional<_Value>{(_Ty &&) __a});
+                stdexec::set_value(((__t&&)*this).base(),
+                                   std::optional<_Value>{(_Ty&&)__a});
             }
             catch (...)
             {
-                stdexec::set_error(((__t &&) * this).base(),
+                stdexec::set_error(((__t&&)*this).base(),
                                    std::current_exception());
             }
         }
@@ -4983,7 +4962,7 @@
         {
             using _Value =
                 __single_sender_value_t<_Sender, env_of_t<_Receiver>>;
-            stdexec::set_value(((__t &&) * this).base(),
+            stdexec::set_value(((__t&&)*this).base(),
                                std::optional<_Value>{std::nullopt});
         }
 
@@ -5003,8 +4982,8 @@
         using __id = __operation;
 
         __t(_Sender&& __sndr, _Receiver&& __rcvr) :
-            __rcvr_((_Receiver &&) __rcvr),
-            __op_state_(connect((_Sender &&) __sndr, __receiver_t{{}, this}))
+            __rcvr_((_Receiver&&)__rcvr),
+            __op_state_(connect((_Sender&&)__sndr, __receiver_t{{}, this}))
         {}
 
         STDEXEC_IMMOVABLE(__t);
@@ -5043,11 +5022,10 @@
                                            env_of_t<_Receiver>> &&
                      sender_to<__copy_cvref_t<_Self, _Sender>,
                                __receiver_t<_Self, _Receiver>>
-                     friend auto tag_invoke(connect_t, _Self&& __self,
-                                            _Receiver __rcvr)
-                         -> __operation_t<_Self, _Receiver>
+        friend auto tag_invoke(connect_t, _Self&& __self, _Receiver __rcvr)
+            -> __operation_t<_Self, _Receiver>
         {
-            return {((_Self &&) __self).__sndr_, (_Receiver &&) __rcvr};
+            return {((_Self&&)__self).__sndr_, (_Receiver&&)__rcvr};
         }
 
         friend auto tag_invoke(get_env_t, const __t& __self) //
@@ -5082,7 +5060,7 @@
     auto operator()(_Sender&& __sndr) const
         -> __t<__sender<stdexec::__id<__decay_t<_Sender>>>>
     {
-        return {(_Sender &&) __sndr};
+        return {(_Sender&&)__sndr};
     }
 
     __binder_back<stopped_as_optional_t> operator()() const noexcept
@@ -5096,19 +5074,19 @@
     template <sender _Sender, __movable_value _Error>
     auto operator()(_Sender&& __sndr, _Error __err) const
     {
-        return (_Sender &&) __sndr |
+        return (_Sender&&)__sndr |
                let_stopped(
-                   [__err2 = (_Error &&) __err]() mutable //
+                   [__err2 = (_Error&&)__err]() mutable //
                    noexcept(std::is_nothrow_move_constructible_v<_Error>) {
-                       return just_error((_Error &&) __err2);
-                   });
+            return just_error((_Error&&)__err2);
+               });
     }
 
     template <__movable_value _Error>
     auto operator()(_Error __err) const
         -> __binder_back<stopped_as_error_t, _Error>
     {
-        return {{}, {}, {(_Error &&) __err}};
+        return {{}, {}, {(_Error&&)__err}};
     }
 };
 } // namespace __stopped_as_xxx
@@ -5159,16 +5137,16 @@
             {
                 if (get_stop_token(get_env(__rcvr)).stop_requested())
                 {
-                    set_stopped((_Receiver &&) __rcvr);
+                    set_stopped((_Receiver&&)__rcvr);
                 }
                 else
                 {
-                    set_value((_Receiver &&) __rcvr);
+                    set_value((_Receiver&&)__rcvr);
                 }
             }
             catch (...)
             {
-                set_error((_Receiver &&) __rcvr, std::current_exception());
+                set_error((_Receiver&&)__rcvr, std::current_exception());
             }
         }
 
@@ -5176,7 +5154,7 @@
 
         __t(__task* __next, run_loop* __loop, _Receiver __rcvr) :
             __task{{}, __next, {&__execute_impl}}, __loop_{__loop},
-            __rcvr_{(_Receiver &&) __rcvr}
+            __rcvr_{(_Receiver&&)__rcvr}
         {}
 
         friend void tag_invoke(start_t, __t& __self) noexcept
@@ -5226,13 +5204,13 @@
                 tag_invoke(connect_t, const __schedule_task& __self,
                            _Receiver __rcvr)
             {
-                return __self.__connect_((_Receiver &&) __rcvr);
+                return __self.__connect_((_Receiver&&)__rcvr);
             }
 
             template <class _Receiver>
             __operation<_Receiver> __connect_(_Receiver&& __rcvr) const
             {
-                return {&__loop_->__head_, __loop_, (_Receiver &&) __rcvr};
+                return {&__loop_->__head_, __loop_, (_Receiver&&)__rcvr};
             }
 
             struct __env
@@ -5320,7 +5298,7 @@
     }
     catch (...)
     {
-        set_error((_Receiver &&) __rcvr_, std::current_exception());
+        set_error((_Receiver&&)__rcvr_, std::current_exception());
     }
 }
 
@@ -5434,8 +5412,7 @@
             requires __callable<_Tag, _Receiver, _As...>
         friend void tag_invoke(_Tag, __t&& __self, _As&&... __as) noexcept
         {
-            _Tag{}((_Receiver &&) __self.__op_state_->__rcvr_,
-                   (_As &&) __as...);
+            _Tag{}((_Receiver&&)__self.__op_state_->__rcvr_, (_As&&)__as...);
         }
 
         friend auto tag_invoke(get_env_t, const __t& __self)
@@ -5479,7 +5456,7 @@
             // execution context.
             __self.__op_state_->__data_
                 .template emplace<__decayed_tuple<_Tag, _Args...>>(
-                    _Tag{}, (_Args &&) __args...);
+                    _Tag{}, (_Args&&)__args...);
             // Enqueue the schedule operation so the completion happens
             // on the scheduler's execution context.
             start(__self.__op_state_->__state2_);
@@ -5491,9 +5468,9 @@
         friend void tag_invoke(_Tag __tag, __t&& __self,
                                _Args&&... __args) noexcept
         {
-            __try_call((_Receiver &&) __self.__op_state_->__rcvr_,
-                       __fun_c<__complete_<_Tag, _Args...>>, (_Tag &&) __tag,
-                       (__t &&) __self, (_Args &&) __args...);
+            __try_call((_Receiver&&)__self.__op_state_->__rcvr_,
+                       __fun_c<__complete_<_Tag, _Args...>>, (_Tag&&)__tag,
+                       (__t&&)__self, (_Args&&)__args...);
         }
 
         friend auto tag_invoke(get_env_t, const __t& __self)
@@ -5527,8 +5504,8 @@
             __state2_;
 
         __t(_Scheduler __sched, _CvrefSender&& __sndr, _Receiver&& __rcvr) :
-            __sched_((_Scheduler &&) __sched), __rcvr_((_Receiver &&) __rcvr),
-            __state1_(connect((_CvrefSender &&) __sndr, __receiver1_t{this})),
+            __sched_((_Scheduler&&)__sched), __rcvr_((_Receiver&&)__rcvr),
+            __state1_(connect((_CvrefSender&&)__sndr, __receiver1_t{this})),
             __state2_(connect(schedule(__sched_), __receiver2_t{this}))
         {}
 
@@ -5554,8 +5531,7 @@
                         std::apply(
                             [&]<class... _Args>(auto __tag,
                                                 _Args&... __args) -> void {
-                                __tag((_Receiver &&) __rcvr_,
-                                      (_Args &&) __args...);
+                                __tag((_Receiver&&)__rcvr_, (_Args&&)__args...);
                             },
                             __tupl);
                     }
@@ -5611,8 +5587,8 @@
                 __operation1<_SchedulerId, stdexec::__cvref_id<_Self, _Sender>,
                              stdexec::__id<_Receiver>>>
         {
-            return {__self.__env_.__sched_, ((_Self &&) __self).__sndr_,
-                    (_Receiver &&) __rcvr};
+            return {__self.__env_.__sched_, ((_Self&&)__self).__sndr_,
+                    (_Receiver&&)__rcvr};
         }
 
         friend const _Attrs& tag_invoke(get_env_t, const __t& __self) noexcept
@@ -5663,7 +5639,7 @@
         noexcept(nothrow_tag_invocable<schedule_from_t, _Scheduler, _Sender>)
             -> tag_invoke_result_t<schedule_from_t, _Scheduler, _Sender>
     {
-        return tag_invoke(*this, (_Scheduler &&) __sched, (_Sender &&) __sndr);
+        return tag_invoke(*this, (_Scheduler&&)__sched, (_Sender&&)__sndr);
     }
 
     template <scheduler _Scheduler, sender _Sender>
@@ -5671,7 +5647,7 @@
         -> stdexec::__t<__sender<stdexec::__id<__decay_t<_Scheduler>>,
                                  stdexec::__id<__decay_t<_Sender>>>>
     {
-        return {{(_Scheduler &&) __sched}, (_Sender &&) __sndr};
+        return {{(_Scheduler&&)__sched}, (_Sender&&)__sndr};
     }
 };
 } // namespace __schedule_from
@@ -5697,8 +5673,8 @@
                  _Sender, _Scheduler>)
     {
         auto csch = get_completion_scheduler<set_value_t>(get_env(__sndr));
-        return tag_invoke(transfer_t{}, std::move(csch), (_Sender &&) __sndr,
-                          (_Scheduler &&) __sched);
+        return tag_invoke(transfer_t{}, std::move(csch), (_Sender&&)__sndr,
+                          (_Scheduler&&)__sched);
     }
 
     template <sender _Sender, scheduler _Scheduler>
@@ -5709,8 +5685,8 @@
         operator()(_Sender&& __sndr, _Scheduler&& __sched) const
         noexcept(nothrow_tag_invocable<transfer_t, _Sender, _Scheduler>)
     {
-        return tag_invoke(transfer_t{}, (_Sender &&) __sndr,
-                          (_Scheduler &&) __sched);
+        return tag_invoke(transfer_t{}, (_Sender&&)__sndr,
+                          (_Scheduler&&)__sched);
     }
 
     // NOT TO SPEC: permit non-typed senders:
@@ -5720,14 +5696,14 @@
                 (!tag_invocable<transfer_t, _Sender, _Scheduler>)
     auto operator()(_Sender&& __sndr, _Scheduler&& __sched) const
     {
-        return schedule_from((_Scheduler &&) __sched, (_Sender &&) __sndr);
+        return schedule_from((_Scheduler&&)__sched, (_Sender&&)__sndr);
     }
 
     template <scheduler _Scheduler>
     __binder_back<transfer_t, __decay_t<_Scheduler>>
         operator()(_Scheduler&& __sched) const
     {
-        return {{}, {}, {(_Scheduler &&) __sched}};
+        return {{}, {}, {(_Scheduler&&)__sched}};
     }
 };
 } // namespace __transfer
@@ -5757,7 +5733,7 @@
 
         _Receiver&& base() && noexcept
         {
-            return (_Receiver &&) __op_state_->__rcvr_;
+            return (_Receiver&&)__op_state_->__rcvr_;
         }
 
         const _Receiver& base() const& noexcept
@@ -5793,7 +5769,7 @@
 
         _Receiver&& base() && noexcept
         {
-            return (_Receiver &&) __op_state_->__rcvr_;
+            return (_Receiver&&)__op_state_->__rcvr_;
         }
 
         const _Receiver& base() const& noexcept
@@ -5810,13 +5786,13 @@
                 // This line will invalidate *this:
                 start(__op_state->__data_.template emplace<1>(
                     __conv{[__op_state] {
-                        return connect((_Sender &&) __op_state->__sndr_,
+                        return connect((_Sender&&)__op_state->__sndr_,
                                        __receiver_ref_t{{}, __op_state});
                     }}));
             }
             catch (...)
             {
-                set_error((_Receiver &&) __op_state->__rcvr_,
+                set_error((_Receiver&&)__op_state->__rcvr_,
                           std::current_exception());
             }
         }
@@ -5845,11 +5821,11 @@
 
         template <class _Sender2, class _Receiver2>
         __t(_Scheduler __sched, _Sender2&& __sndr, _Receiver2&& __rcvr) :
-            __scheduler_((_Scheduler &&) __sched),
-            __sndr_((_Sender2 &&) __sndr), __rcvr_((_Receiver2 &&) __rcvr),
-            __data_{std::in_place_index<0>, __conv{[this] {
-                        return connect(schedule(__scheduler_),
-                                       __receiver_t{{}, this});
+            __scheduler_((_Scheduler&&)__sched), __sndr_((_Sender2&&)__sndr),
+            __rcvr_((_Receiver2&&)__rcvr),
+            __data_{std::in_place_index<0>, __conv{
+                                                [this] {
+            return connect(schedule(__scheduler_), __receiver_t{{}, this});
                     }}}
         {}
 
@@ -5896,12 +5872,11 @@
                                __receiver_t<stdexec::__id<_Receiver>>> &&
                      sender_to<_Sender,
                                __receiver_ref_t<stdexec::__id<_Receiver>>>
-                     friend auto tag_invoke(connect_t, _Self&& __self,
-                                            _Receiver __rcvr)
-                         -> __operation_t<stdexec::__id<_Receiver>>
+        friend auto tag_invoke(connect_t, _Self&& __self, _Receiver __rcvr)
+            -> __operation_t<stdexec::__id<_Receiver>>
         {
-            return {((_Self &&) __self).__scheduler_,
-                    ((_Self &&) __self).__sndr_, (_Receiver &&) __rcvr};
+            return {((_Self&&)__self).__scheduler_, ((_Self&&)__self).__sndr_,
+                    (_Receiver&&)__rcvr};
         }
 
         friend auto tag_invoke(get_env_t, const __t& __self) //
@@ -5934,7 +5909,7 @@
         noexcept(nothrow_tag_invocable<on_t, _Scheduler, _Sender>)
             -> tag_invoke_result_t<on_t, _Scheduler, _Sender>
     {
-        return tag_invoke(*this, (_Scheduler &&) __sched, (_Sender &&) __sndr);
+        return tag_invoke(*this, (_Scheduler&&)__sched, (_Sender&&)__sndr);
     }
 
     template <scheduler _Scheduler, sender _Sender>
@@ -5949,7 +5924,7 @@
             !__has_customizations{},
             "For now the default stdexec::on implementation doesn't support scheduling "
             "onto schedulers that customize algorithms.");
-        return {(_Scheduler &&) __sched, (_Sender &&) __sndr};
+        return {(_Scheduler&&)__sched, (_Sender&&)__sndr};
     }
 };
 } // namespace __on
@@ -5967,15 +5942,11 @@
         requires tag_invocable<transfer_just_t, _Scheduler, _Values...> &&
                  sender<tag_invoke_result_t<transfer_just_t, _Scheduler,
                                             _Values...>>
-                 auto operator()(_Scheduler&& __sched,
-                                 _Values&&... __vals) const
-                 noexcept(nothrow_tag_invocable<transfer_just_t, _Scheduler,
-                                                _Values...>)
-                     -> tag_invoke_result_t<transfer_just_t, _Scheduler,
-                                            _Values...>
+    auto operator()(_Scheduler&& __sched, _Values&&... __vals) const
+        noexcept(nothrow_tag_invocable<transfer_just_t, _Scheduler, _Values...>)
+            -> tag_invoke_result_t<transfer_just_t, _Scheduler, _Values...>
     {
-        return tag_invoke(*this, (_Scheduler &&) __sched,
-                          (_Values &&) __vals...);
+        return tag_invoke(*this, (_Scheduler&&)__sched, (_Values&&)__vals...);
     }
 
     template <scheduler _Scheduler, __movable_value... _Values>
@@ -5983,10 +5954,9 @@
                  !sender<tag_invoke_result_t<transfer_just_t, _Scheduler,
                                              _Values...>>)
     auto operator()(_Scheduler&& __sched, _Values&&... __vals) const
-        -> decltype(transfer(just((_Values &&) __vals...),
-                             (_Scheduler &&) __sched))
+        -> decltype(transfer(just((_Values&&)__vals...), (_Scheduler&&)__sched))
     {
-        return transfer(just((_Values &&) __vals...), (_Scheduler &&) __sched);
+        return transfer(just((_Values&&)__vals...), (_Scheduler&&)__sched);
     }
 };
 } // namespace __transfer_just
@@ -6022,12 +5992,12 @@
         {
             try
             {
-                set_value((_Receiver &&) __self.__rcvr_,
-                          _Variant{std::tuple<_As&&...>{(_As &&) __as...}});
+                set_value((_Receiver&&)__self.__rcvr_,
+                          _Variant{std::tuple<_As&&...>{(_As&&)__as...}});
             }
             catch (...)
             {
-                set_error((_Receiver &&) __self.__rcvr_,
+                set_error((_Receiver&&)__self.__rcvr_,
                           std::current_exception());
             }
         }
@@ -6036,12 +6006,12 @@
         friend void tag_invoke(set_error_t, __t&& __self,
                                _Error&& __err) noexcept
         {
-            set_error((_Receiver &&) __self.__rcvr_, (_Error &&) __err);
+            set_error((_Receiver&&)__self.__rcvr_, (_Error&&)__err);
         }
 
         friend void tag_invoke(set_stopped_t, __t&& __self) noexcept
         {
-            set_stopped((_Receiver &&) __self.__rcvr_);
+            set_stopped((_Receiver&&)__self.__rcvr_);
         }
 
         friend env_of_t<_Receiver> tag_invoke(get_env_t, const __t& __self)
@@ -6070,7 +6040,7 @@
         using is_sender = void;
 
         template <__decays_to<_Sender> _CvrefSender>
-        explicit __t(_CvrefSender&& __sndr) : __sndr_((_CvrefSender &&) __sndr)
+        explicit __t(_CvrefSender&& __sndr) : __sndr_((_CvrefSender&&)__sndr)
         {}
 
       private:
@@ -6094,8 +6064,8 @@
                 -> connect_result_t<_Sender, __receiver_t<_Receiver>>
         {
             return stdexec::connect(
-                (_Sender &&) __self.__sndr_,
-                __receiver_t<_Receiver>{(_Receiver &&) __rcvr});
+                (_Sender&&)__self.__sndr_,
+                __receiver_t<_Receiver>{(_Receiver&&)__rcvr});
         }
 
         friend auto tag_invoke(get_env_t, const __t& __self) //
@@ -6117,8 +6087,8 @@
     auto operator()(_Sender&& __sndr) const
         -> __t<__sender<stdexec::__id<__decay_t<_Sender>>>>
     {
-        return __t<__sender<stdexec::__id<__decay_t<_Sender>>>>{(_Sender &&)
-                                                                    __sndr};
+        return __t<__sender<stdexec::__id<__decay_t<_Sender>>>>{
+            (_Sender&&)__sndr};
     }
 
     auto operator()() const noexcept
@@ -6183,7 +6153,7 @@
                                   const __make_dependent_on<_Env, _Self>&,
                                   _As...>
         {
-            return ((_Tag &&) __tag)(__self.__base_env_, (_As &&) __as...);
+            return ((_Tag&&)__tag)(__self.__base_env_, (_As&&)__as...);
         }
     };
 };
@@ -6262,13 +6232,13 @@
     {
         if constexpr (!same_as<_Ty, __not_an_error>)
         {
-            _Tag{}((_Receiver &&) __rcvr_, (_Ty &&) __t, (_Ts &&) __ts...);
+            _Tag{}((_Receiver&&)__rcvr_, (_Ty&&)__t, (_Ts&&)__ts...);
         }
     }
 
     void operator()() const noexcept
     {
-        _Tag{}((_Receiver &&) __rcvr_);
+        _Tag{}((_Receiver&&)__rcvr_);
     }
 };
 
@@ -6319,7 +6289,7 @@
                 }
                 break;
             case __stopped:
-                stdexec::set_stopped((_Receiver &&) __recvr_);
+                stdexec::set_stopped((_Receiver&&)__recvr_);
                 break;
             default:;
         }
@@ -6364,15 +6334,15 @@
                 if constexpr (__nothrow_decay_copyable<_Error>)
                 {
                     __op_state_->__errors_.template emplace<__decay_t<_Error>>(
-                        (_Error &&) __err);
+                        (_Error&&)__err);
                 }
                 else
                 {
                     try
                     {
                         __op_state_->__errors_
-                            .template emplace<__decay_t<_Error>>((_Error &&)
-                                                                     __err);
+                            .template emplace<__decay_t<_Error>>(
+                                (_Error&&)__err);
                     }
                     catch (...)
                     {
@@ -6402,14 +6372,14 @@
                     if constexpr ((__nothrow_decay_copyable<_Values> && ...))
                     {
                         std::get<_Index>(__self.__op_state_->__values_)
-                            .emplace((_Values &&) __vals...);
+                            .emplace((_Values&&)__vals...);
                     }
                     else
                     {
                         try
                         {
                             std::get<_Index>(__self.__op_state_->__values_)
-                                .emplace((_Values &&) __vals...);
+                                .emplace((_Values&&)__vals...);
                         }
                         catch (...)
                         {
@@ -6424,12 +6394,12 @@
         template <class _Error>
             requires requires(_ErrorsVariant& __errors, _Error&& __err) {
                          __errors.template emplace<__decay_t<_Error>>(
-                             (_Error &&) __err);
+                             (_Error&&)__err);
                      }
         friend void tag_invoke(set_error_t, __t&& __self,
                                _Error&& __err) noexcept
         {
-            __self.__set_error((_Error &&) __err);
+            __self.__set_error((_Error&&)__err);
             __self.__op_state_->__arrive();
         }
 
@@ -6553,17 +6523,16 @@
         template <class _SendersTuple, std::size_t... _Is>
         __t(_SendersTuple&& __sndrs, _Receiver __rcvr,
             std::index_sequence<_Is...>) :
-            __operation_base_t{{}, (_Receiver &&) __rcvr, {sizeof...(_Is)}},
+            __operation_base_t{{}, (_Receiver&&)__rcvr, {sizeof...(_Is)}},
             __op_states_{__conv{[&__sndrs, this]() {
-                return stdexec::connect(
-                    std::get<_Is>((_SendersTuple &&) __sndrs),
-                    __receiver_t<_Is>{this});
+                return stdexec::connect(std::get<_Is>((_SendersTuple&&)__sndrs),
+                                        __receiver_t<_Is>{this});
             }}...}
         {}
 
         template <class _SendersTuple>
         __t(_SendersTuple&& __sndrs, _Receiver __rcvr) :
-            __t((_SendersTuple &&) __sndrs, (_Receiver &&) __rcvr, _Indices{})
+            __t((_SendersTuple&&)__sndrs, (_Receiver&&)__rcvr, _Indices{})
         {}
 
         friend void tag_invoke(start_t, __t& __self) noexcept
@@ -6576,7 +6545,7 @@
             {
                 // Stop has already been requested. Don't bother starting
                 // the child operations.
-                stdexec::set_stopped((_Receiver &&) __self.__recvr_);
+                stdexec::set_stopped((_Receiver&&)__self.__recvr_);
             }
             else
             {
@@ -6627,7 +6596,7 @@
 
         template <class... _Sndrs>
         explicit(sizeof...(_Sndrs) == 1) __t(_Sndrs&&... __sndrs) :
-            __sndrs_((_Sndrs &&) __sndrs...)
+            __sndrs_((_Sndrs&&)__sndrs...)
         {}
 
       private:
@@ -6638,7 +6607,7 @@
         friend auto tag_invoke(connect_t, _Self&& __self, _Receiver __rcvr)
             -> __operation_t<_Self, _Receiver>
         {
-            return {((_Self &&) __self).__sndrs_, (_Receiver &&) __rcvr};
+            return {((_Self&&)__self).__sndrs_, (_Receiver&&)__rcvr};
         }
 
         template <__decays_to<__t> _Self, class _Env>
@@ -6670,11 +6639,11 @@
     template <sender... _Senders>
         requires tag_invocable<when_all_t, _Senders...> &&
                  sender<tag_invoke_result_t<when_all_t, _Senders...>>
-                 auto operator()(_Senders&&... __sndrs) const
-                 noexcept(nothrow_tag_invocable<when_all_t, _Senders...>)
-                     -> tag_invoke_result_t<when_all_t, _Senders...>
+    auto operator()(_Senders&&... __sndrs) const
+        noexcept(nothrow_tag_invocable<when_all_t, _Senders...>)
+            -> tag_invoke_result_t<when_all_t, _Senders...>
     {
-        return tag_invoke(*this, (_Senders &&) __sndrs...);
+        return tag_invoke(*this, (_Senders&&)__sndrs...);
     }
 
     template <sender... _Senders>
@@ -6682,7 +6651,7 @@
                 sender<__sender_t<_Senders...>>
     __sender_t<_Senders...> operator()(_Senders&&... __sndrs) const
     {
-        return __sender_t<_Senders...>{(_Senders &&) __sndrs...};
+        return __sender_t<_Senders...>{(_Senders&&)__sndrs...};
     }
 };
 
@@ -6692,13 +6661,11 @@
         requires tag_invocable<when_all_with_variant_t, _Senders...> &&
                  sender<
                      tag_invoke_result_t<when_all_with_variant_t, _Senders...>>
-                 auto operator()(_Senders&&... __sndrs) const
-                 noexcept(nothrow_tag_invocable<when_all_with_variant_t,
-                                                _Senders...>)
-                     -> tag_invoke_result_t<when_all_with_variant_t,
-                                            _Senders...>
+    auto operator()(_Senders&&... __sndrs) const
+        noexcept(nothrow_tag_invocable<when_all_with_variant_t, _Senders...>)
+            -> tag_invoke_result_t<when_all_with_variant_t, _Senders...>
     {
-        return tag_invoke(*this, (_Senders &&) __sndrs...);
+        return tag_invoke(*this, (_Senders&&)__sndrs...);
     }
 
     template <sender... _Senders>
@@ -6706,7 +6673,7 @@
                 (__callable<into_variant_t, _Senders> && ...)
     auto operator()(_Senders&&... __sndrs) const
     {
-        return when_all_t{}(into_variant((_Senders &&) __sndrs)...);
+        return when_all_t{}(into_variant((_Senders&&)__sndrs)...);
     }
 };
 
@@ -6716,13 +6683,11 @@
         requires tag_invocable<transfer_when_all_t, _Sched, _Senders...> &&
                  sender<tag_invoke_result_t<transfer_when_all_t, _Sched,
                                             _Senders...>>
-                 auto operator()(_Sched&& __sched, _Senders&&... __sndrs) const
-                 noexcept(nothrow_tag_invocable<transfer_when_all_t, _Sched,
-                                                _Senders...>)
-                     -> tag_invoke_result_t<transfer_when_all_t, _Sched,
-                                            _Senders...>
+    auto operator()(_Sched&& __sched, _Senders&&... __sndrs) const noexcept(
+        nothrow_tag_invocable<transfer_when_all_t, _Sched, _Senders...>)
+        -> tag_invoke_result_t<transfer_when_all_t, _Sched, _Senders...>
     {
-        return tag_invoke(*this, (_Sched &&) __sched, (_Senders &&) __sndrs...);
+        return tag_invoke(*this, (_Sched&&)__sched, (_Senders&&)__sndrs...);
     }
 
     template <scheduler _Sched, sender... _Senders>
@@ -6731,8 +6696,8 @@
                                               _Senders...>>))
     auto operator()(_Sched&& __sched, _Senders&&... __sndrs) const
     {
-        return transfer(when_all_t{}((_Senders &&) __sndrs...),
-                        (_Sched &&) __sched);
+        return transfer(when_all_t{}((_Senders&&)__sndrs...),
+                        (_Sched&&)__sched);
     }
 };
 
@@ -6743,14 +6708,13 @@
                                _Senders...> &&
                  sender<tag_invoke_result_t<transfer_when_all_with_variant_t,
                                             _Sched, _Senders...>>
-                 auto operator()(_Sched&& __sched, _Senders&&... __sndrs) const
-                 noexcept(
-                     nothrow_tag_invocable<transfer_when_all_with_variant_t,
-                                           _Sched, _Senders...>)
-                     -> tag_invoke_result_t<transfer_when_all_with_variant_t,
-                                            _Sched, _Senders...>
+    auto operator()(_Sched&& __sched, _Senders&&... __sndrs) const
+        noexcept(nothrow_tag_invocable<transfer_when_all_with_variant_t, _Sched,
+                                       _Senders...>)
+            -> tag_invoke_result_t<transfer_when_all_with_variant_t, _Sched,
+                                   _Senders...>
     {
-        return tag_invoke(*this, (_Sched &&) __sched, (_Senders &&) __sndrs...);
+        return tag_invoke(*this, (_Sched&&)__sched, (_Senders&&)__sndrs...);
     }
 
     template <scheduler _Sched, sender... _Senders>
@@ -6759,8 +6723,8 @@
                 (__callable<into_variant_t, _Senders> && ...)
     auto operator()(_Sched&& __sched, _Senders&&... __sndrs) const
     {
-        return transfer_when_all_t{}((_Sched &&) __sched,
-                                     into_variant((_Senders &&) __sndrs)...);
+        return transfer_when_all_t{}((_Sched&&)__sched,
+                                     into_variant((_Senders&&)__sndrs)...);
     }
 };
 } // namespace __when_all
@@ -6821,7 +6785,7 @@
         noexcept(std::is_nothrow_move_constructible_v<_Receiver>)
             -> stdexec::__t<__operation<_Tag, stdexec::__id<_Receiver>>>
     {
-        return {{}, (_Receiver &&) __rcvr};
+        return {{}, (_Receiver&&)__rcvr};
     }
 
     template <class _Env>
@@ -6935,13 +6899,13 @@
         void __set_error(_Error __err) noexcept
         {
             if constexpr (__decays_to<_Error, std::exception_ptr>)
-                __state_->__data_.template emplace<2>((_Error &&) __err);
+                __state_->__data_.template emplace<2>((_Error&&)__err);
             else if constexpr (__decays_to<_Error, std::error_code>)
                 __state_->__data_.template emplace<2>(
                     std::make_exception_ptr(std::system_error(__err)));
             else
                 __state_->__data_.template emplace<2>(
-                    std::make_exception_ptr((_Error &&) __err));
+                    std::make_exception_ptr((_Error&&)__err));
             __loop_->finish();
         }
 
@@ -6952,7 +6916,7 @@
         {
             try
             {
-                __rcvr.__state_->__data_.template emplace<1>((_As &&) __as...);
+                __rcvr.__state_->__data_.template emplace<1>((_As&&)__as...);
                 __rcvr.__loop_->finish();
             }
             catch (...)
@@ -6965,7 +6929,7 @@
         friend void tag_invoke(stdexec::set_error_t, __t&& __rcvr,
                                _Error __err) noexcept
         {
-            __rcvr.__set_error((_Error &&) __err);
+            __rcvr.__set_error((_Error&&)__err);
         }
 
         friend void tag_invoke(stdexec::set_stopped_t __d,
@@ -7005,8 +6969,7 @@
                  _Sender>)
     {
         auto __sched = get_completion_scheduler<set_value_t>(get_env(__sndr));
-        return tag_invoke(sync_wait_t{}, std::move(__sched),
-                          (_Sender &&) __sndr);
+        return tag_invoke(sync_wait_t{}, std::move(__sched), (_Sender&&)__sndr);
     }
 
     // TODO: constrain on return type
@@ -7017,7 +6980,7 @@
     tag_invoke_result_t<sync_wait_t, _Sender> operator()(_Sender&& __sndr) const
         noexcept(nothrow_tag_invocable<sync_wait_t, _Sender>)
     {
-        return tag_invoke(sync_wait_t{}, (_Sender &&) __sndr);
+        return tag_invoke(sync_wait_t{}, (_Sender&&)__sndr);
     }
 
     template <__single_value_variant_sender<__env> _Sender>
@@ -7026,8 +6989,8 @@
                 (!tag_invocable<sync_wait_t, _Sender>) &&
                 sender_in<_Sender, __env> &&
                 sender_to<_Sender, __receiver_t<_Sender>>
-                auto operator()(_Sender&& __sndr) const
-                -> std::optional<__sync_wait_result_t<_Sender>>
+    auto operator()(_Sender&& __sndr) const
+        -> std::optional<__sync_wait_result_t<_Sender>>
     {
         using state_t = __sync_wait_result_impl<_Sender, __q<__state>>;
         state_t __state{};
@@ -7035,7 +6998,7 @@
 
         // Launch the sender with a continuation that will fill in a variant
         // and notify a condition variable.
-        auto __op_state = connect((_Sender &&) __sndr,
+        auto __op_state = connect((_Sender&&)__sndr,
                                   __receiver_t<_Sender>{&__state, &__loop});
         start(__op_state);
 
@@ -7078,7 +7041,7 @@
 
         auto __sched = get_completion_scheduler<set_value_t>(get_env(__sndr));
         return tag_invoke(sync_wait_with_variant_t{}, std::move(__sched),
-                          (_Sender &&) __sndr);
+                          (_Sender&&)__sndr);
     }
 
     template <sender_in<__env> _Sender>
@@ -7096,7 +7059,7 @@
             "The type of tag_invoke(sync_wait_with_variant, S) "
             "must be sync-wait-with-variant-type<S, sync-wait-env>");
 
-        return tag_invoke(sync_wait_with_variant_t{}, (_Sender &&) __sndr);
+        return tag_invoke(sync_wait_with_variant_t{}, (_Sender&&)__sndr);
     }
 
     template <sender_in<__env> _Sender>
@@ -7107,7 +7070,7 @@
     std::optional<__sync_wait_with_variant_result_t<_Sender>>
         operator()(_Sender&& __sndr) const
     {
-        return sync_wait_t{}(into_variant((_Sender &&) __sndr));
+        return sync_wait_t{}(into_variant((_Sender&&)__sndr));
     }
 };
 } // namespace __sync_wait
diff --git a/include/sdbusplus/async/stdexec/functional.hpp b/include/sdbusplus/async/stdexec/functional.hpp
index 0a6a603..dad3c16 100644
--- a/include/sdbusplus/async/stdexec/functional.hpp
+++ b/include/sdbusplus/async/stdexec/functional.hpp
@@ -32,7 +32,7 @@
 template <class _Fun, class... _As>
 concept invocable = //
     requires(_Fun&& __f, _As&&... __as) {
-        std::invoke((_Fun &&) __f, (_As &&) __as...);
+        std::invoke((_Fun&&)__f, (_As&&)__as...);
     };
 #endif
 } // namespace stdexec::__std_concepts
@@ -49,7 +49,7 @@
     invocable<_Fun, _As...> && //
     requires(_Fun&& __f, _As&&... __as) {
         {
-            std::invoke((_Fun &&) __f, (_As &&) __as...)
+            std::invoke((_Fun&&)__f, (_As&&)__as...)
         } noexcept;
     };
 
@@ -61,10 +61,10 @@
     template <class... _Args>
         requires __callable<_FunT, _Args...>
     auto operator()(_Args&&... __args) const
-        noexcept(noexcept(_Fun((_Args &&) __args...)))
+        noexcept(noexcept(_Fun((_Args&&)__args...)))
             -> __call_result_t<_FunT, _Args...>
     {
-        return _Fun((_Args &&) __args...);
+        return _Fun((_Args&&)__args...);
     }
 };
 
@@ -82,14 +82,14 @@
 template <class _Tag, class... _Args>
 concept tag_invocable = //
     requires(_Tag __tag, _Args&&... __args) {
-        tag_invoke((_Tag &&) __tag, (_Args &&) __args...);
+        tag_invoke((_Tag&&)__tag, (_Args&&)__args...);
     };
 
 template <class _Ret, class _Tag, class... _Args>
 concept __tag_invocable_r = //
     requires(_Tag __tag, _Args&&... __args) {
         {
-            static_cast<_Ret>(tag_invoke((_Tag &&) __tag, (_Args &&) __args...))
+            static_cast<_Ret>(tag_invoke((_Tag&&)__tag, (_Args&&)__args...))
         };
     };
 
@@ -99,7 +99,7 @@
     tag_invocable<_Tag, _Args...> && //
     requires(_Tag __tag, _Args&&... __args) {
         {
-            tag_invoke((_Tag &&) __tag, (_Args &&) __args...)
+            tag_invoke((_Tag&&)__tag, (_Args&&)__args...)
         } noexcept;
     };
 
@@ -128,7 +128,7 @@
         noexcept(nothrow_tag_invocable<_Tag, _Args...>)
             -> tag_invoke_result_t<_Tag, _Args...>
     {
-        return tag_invoke((_Tag &&) __tag, (_Args &&) __args...);
+        return tag_invoke((_Tag&&)__tag, (_Args&&)__args...);
     }
 };
 } // namespace __tag_invoke
diff --git a/include/sdbusplus/async/stdexec/inline_scheduler.hpp b/include/sdbusplus/async/stdexec/inline_scheduler.hpp
index ec7ca3c..00049b2 100644
--- a/include/sdbusplus/async/stdexec/inline_scheduler.hpp
+++ b/include/sdbusplus/async/stdexec/inline_scheduler.hpp
@@ -34,7 +34,7 @@
 
         friend void tag_invoke(stdexec::start_t, __op& op) noexcept
         {
-            stdexec::set_value((R &&) op.rec_);
+            stdexec::set_value((R&&)op.rec_);
         }
     };
 
@@ -50,7 +50,7 @@
                 stdexec::__nothrow_constructible_from<stdexec::__decay_t<R>, R>)
                 -> __op<stdexec::__x<stdexec::__decay_t<R>>>
         {
-            return {(R &&) rec};
+            return {(R&&)rec};
         }
 
         struct __env
diff --git a/include/sdbusplus/async/stdexec/stop_token.hpp b/include/sdbusplus/async/stdexec/stop_token.hpp
index a518051..559f070 100644
--- a/include/sdbusplus/async/stdexec/stop_token.hpp
+++ b/include/sdbusplus/async/stdexec/stop_token.hpp
@@ -243,7 +243,7 @@
         noexcept(__nothrow_constructible_from<_Fun, _Fun2>) :
         __stok::__in_place_stop_callback_base(
             __token.__source_, &in_place_stop_callback::__execute_impl_),
-        __fun_((_Fun2 &&) __fun)
+        __fun_((_Fun2&&)__fun)
     {
         __register_callback_();
     }
@@ -456,11 +456,11 @@
                           requires(const _Token& __token) {
                               {
                                   __token.stop_requested()
-                                  } noexcept -> __boolean_testable_;
+                              } noexcept -> __boolean_testable_;
                               {
                                   __token.stop_possible()
-                                  } noexcept -> __boolean_testable_;
-        // workaround ICE in appleclang 13.1
+                              } noexcept -> __boolean_testable_;
+    // workaround ICE in appleclang 13.1
 #if !defined(__clang__)
                               typename __stok::__check_type_alias_exists<
                                   _Token::template callback_type>;
@@ -474,13 +474,13 @@
     constructible_from<_Callback, _Initializer> &&                      //
     constructible_from<                                                 //
         typename _Token::template callback_type<_Callback>, _Token,
-        _Initializer> && //
-    constructible_from<  //
+        _Initializer> &&                                                //
+    constructible_from<                                                 //
         typename _Token::template callback_type<_Callback>, _Token&,
-        _Initializer> && //
-    constructible_from<  //
+        _Initializer> &&                                                //
+    constructible_from<                                                 //
         typename _Token::template callback_type<_Callback>, const _Token,
-        _Initializer> && //
+        _Initializer> &&                                                //
     constructible_from<typename _Token::template callback_type<_Callback>,
                        const _Token&, _Initializer>;
 
@@ -490,7 +490,7 @@
     requires {
         {
             _Token::stop_possible()
-            } -> __boolean_testable_;
+        } -> __boolean_testable_;
     } && //
     (!_Token::stop_possible());
 } // namespace stdexec
diff --git a/include/sdbusplus/async/stdexec/task.hpp b/include/sdbusplus/async/stdexec/task.hpp
index a3d84eb..625ea8e 100644
--- a/include/sdbusplus/async/stdexec/task.hpp
+++ b/include/sdbusplus/async/stdexec/task.hpp
@@ -38,8 +38,8 @@
 {
 using namespace stdexec;
 
-using __any_scheduler = //
-    any_receiver_ref<   //
+using __any_scheduler =                        //
+    any_receiver_ref<                          //
         completion_signatures<set_error_t(std::exception_ptr),
                               set_stopped_t()> //
         >::any_sender<>::any_scheduler<>;
@@ -55,7 +55,7 @@
     requires(const _Ty& t) {
         {
             get_env(t)
-            } -> __stop_token_provider;
+        } -> __stop_token_provider;
     };
 
 template <class _Ty>
@@ -63,7 +63,7 @@
     requires(const _Ty& t) {
         {
             get_env(t)
-            } -> __scheduler_provider;
+        } -> __scheduler_provider;
     };
 
 template <class _ParentPromise>
@@ -130,7 +130,7 @@
 
     template <scheduler _Scheduler>
     explicit __default_task_context_impl(_Scheduler&& __scheduler) :
-        __scheduler_{(_Scheduler &&) __scheduler}
+        __scheduler_{(_Scheduler&&)__scheduler}
     {}
 
     bool stop_requested() const noexcept
@@ -142,7 +142,7 @@
     void set_scheduler(_Scheduler&& __sched)
         requires(__with_scheduler)
     {
-        __scheduler_ = (_Scheduler &&) __sched;
+        __scheduler_ = (_Scheduler&&)__sched;
     }
 
     template <class _ThisPromise>
@@ -358,7 +358,7 @@
     template <scheduler _Scheduler>
     __wrap<_Scheduler> operator()(_Scheduler __sched) const noexcept
     {
-        return {(_Scheduler &&) __sched};
+        return {(_Scheduler&&)__sched};
     }
 };
 
@@ -430,19 +430,19 @@
         }
 
         template <sender _Awaitable>
-            requires __scheduler_provider<_Context> decltype(auto)
-        await_transform(_Awaitable&& __awaitable) noexcept
+            requires __scheduler_provider<_Context>
+        decltype(auto) await_transform(_Awaitable&& __awaitable) noexcept
         {
             // TODO: If we have a complete-where-it-starts query then we can
             // optimize this to avoid the reschedule
-            return as_awaitable(transfer((_Awaitable &&) __awaitable,
-                                         get_scheduler(__context_)),
-                                *this);
+            return as_awaitable(
+                transfer((_Awaitable&&)__awaitable, get_scheduler(__context_)),
+                *this);
         }
 
         template <class _Scheduler>
-            requires __scheduler_provider<_Context> decltype(auto)
-        await_transform(
+            requires __scheduler_provider<_Context>
+        decltype(auto) await_transform(
             __reschedule_coroutine_on::__wrap<_Scheduler> __box) noexcept
         {
             if (!std::exchange(__rescheduled_, true))
@@ -468,7 +468,7 @@
         decltype(auto) await_transform(_Awaitable&& __awaitable) noexcept
         {
             return with_awaitable_senders<__promise>::await_transform(
-                (_Awaitable &&) __awaitable);
+                (_Awaitable&&)__awaitable);
         }
 
         using __context_t =
diff --git a/include/sdbusplus/server/object.hpp b/include/sdbusplus/server/object.hpp
index d0d3fd0..f52a263 100644
--- a/include/sdbusplus/server/object.hpp
+++ b/include/sdbusplus/server/object.hpp
@@ -195,12 +195,12 @@
     void try_emit()
     {
         // If T is a normal class with emit_added, call it.
-        if constexpr (requires(T & t) { t.emit_added(); })
+        if constexpr (requires(T& t) { t.emit_added(); })
         {
             this->T::emit_added();
         }
         // If T is a recursive object_t, call its maybe_emit_iface_added.
-        if constexpr (requires(T & t) { t.maybe_emit_iface_added(); })
+        if constexpr (requires(T& t) { t.maybe_emit_iface_added(); })
         {
             this->T::maybe_emit_iface_added();
         }
diff --git a/include/sdbusplus/timer.hpp b/include/sdbusplus/timer.hpp
index 526a050..2401763 100644
--- a/include/sdbusplus/timer.hpp
+++ b/include/sdbusplus/timer.hpp
@@ -178,8 +178,8 @@
             0,               // Use default event accuracy
             [](sd_event_source* /*eventSource*/, uint64_t /*usec*/,
                void* userData) {
-                auto timer = static_cast<Timer*>(userData);
-                return timer->timeoutHandler();
+            auto timer = static_cast<Timer*>(userData);
+            return timer->timeoutHandler();
             },     // Callback handler on timeout
             this); // User data
         if (r < 0)
diff --git a/include/sdbusplus/unpack_properties.hpp b/include/sdbusplus/unpack_properties.hpp
index aa63d88..f232130 100644
--- a/include/sdbusplus/unpack_properties.hpp
+++ b/include/sdbusplus/unpack_properties.hpp
@@ -23,9 +23,10 @@
     const std::vector<std::pair<std::string, VariantType>>& container,
     const std::string& key) noexcept
 {
-    return std::find_if(
-        container.begin(), container.end(),
-        [&key](const auto& keyValue) { return keyValue.first == key; });
+    return std::find_if(container.begin(), container.end(),
+                        [&key](const auto& keyValue) {
+        return keyValue.first == key;
+    });
 }
 
 template <typename OnErrorCallback, typename VariantType, typename ValueType>
@@ -145,7 +146,7 @@
 {
     details::unpackPropertiesCommon(
         [](const UnpackErrorReason reason, const std::string& property) {
-            throw exception::UnpackPropertyError(property, reason);
+        throw exception::UnpackPropertyError(property, reason);
         },
         input, std::forward<Args>(args)...);
 }
diff --git a/include/sdbusplus/utility/memory.hpp b/include/sdbusplus/utility/memory.hpp
index 49dc999..11755be 100644
--- a/include/sdbusplus/utility/memory.hpp
+++ b/include/sdbusplus/utility/memory.hpp
@@ -13,4 +13,4 @@
     *(void**)p = mfree(*(void**)p);
 }
 #define _cleanup_free_ _cleanup_(freep)
-#define _cleanup_(x) __attribute__((__cleanup__(x)))
\ No newline at end of file
+#define _cleanup_(x) __attribute__((__cleanup__(x)))
diff --git a/src/async/match.cpp b/src/async/match.cpp
index 410e840..ae8ed73 100644
--- a/src/async/match.cpp
+++ b/src/async/match.cpp
@@ -6,8 +6,8 @@
 match::match(context& ctx, const std::string_view& pattern)
 {
     // C-style callback to redirect into this::handle_match.
-    static auto match_cb = [](message::msgp_t msg, void* ctx,
-                              sd_bus_error*) noexcept {
+    static auto match_cb =
+        [](message::msgp_t msg, void* ctx, sd_bus_error*) noexcept {
         static_cast<match*>(ctx)->handle_match(message_t{msg});
         return 0;
     };
diff --git a/test/bus/match.cpp b/test/bus/match.cpp
index 049e033..d925c7a 100644
--- a/test/bus/match.cpp
+++ b/test/bus/match.cpp
@@ -29,8 +29,8 @@
 TEST_F(Match, FunctorIs_sd_bus_message_handler_t)
 {
     bool triggered = false;
-    auto trigger = [](sd_bus_message* /*m*/, void* context,
-                      sd_bus_error* /*e*/) {
+    auto trigger =
+        [](sd_bus_message* /*m*/, void* context, sd_bus_error* /*e*/) {
         *static_cast<bool*>(context) = true;
         return 0;
     };
diff --git a/test/message/call.cpp b/test/message/call.cpp
index f0122ee..69c8d43 100644
--- a/test/message/call.cpp
+++ b/test/message/call.cpp
@@ -87,13 +87,13 @@
 {
     EXPECT_DEATH(
         [] {
-            auto b = bus::new_bus();
-            while (b.process_discard())
-                ;
-            auto slot = newBusIdReq(b).call_async(
-                [&](message&&) { throw std::runtime_error("testerror"); });
-            b.wait(1s);
-            b.process_discard();
+        auto b = bus::new_bus();
+        while (b.process_discard())
+            ;
+        auto slot = newBusIdReq(b).call_async(
+            [&](message&&) { throw std::runtime_error("testerror"); });
+        b.wait(1s);
+        b.process_discard();
         }(),
         "testerror");
 }
diff --git a/test/unpack_properties.cpp b/test/unpack_properties.cpp
index bd349e7..3ed04ca 100644
--- a/test/unpack_properties.cpp
+++ b/test/unpack_properties.cpp
@@ -34,7 +34,7 @@
         unpackPropertiesNoThrow(
             [&error](sdbusplus::UnpackErrorReason reason,
                      const std::string& property) {
-                error.emplace(reason, property);
+            error.emplace(reason, property);
             },
             std::forward<Args>(args)...);
         return error;
