From d87dfa14c806e5165c2d988e9d05c07ca7c094c1 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Thu, 4 Jan 2024 09:01:04 -0800 Subject: [PATCH 1/3] add an exposition-only utility for emplacing immovable types in containers --- execution.bs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/execution.bs b/execution.bs index fbd2dc8..e2e624e 100644 --- a/execution.bs +++ b/execution.bs @@ -5007,6 +5007,25 @@ enum class forward_progress_guarantee { [*Note:* The `transfer` algorithm is unique in that it ignores the execution domain of its predecessor, using only its destination scheduler to select a customization. *--end note*] + 11.
+        template<callable Fun>
+          requires is_nothrow_move_constructible_v<Fun>
+        struct emplace-construct { // exposition only
+          Fun fun; // exposition only
+          using type = call-result-t<Fun>;
+
+          constexpr operator type() && noexcept(nothrow-callable<Fun>) {
+            return std::move(fun)();
+          }
+
+          constexpr type operator()() && noexcept(nothrow-callable<Fun>) {
+            return std::move(fun)();
+          }
+        };
+        
+ + 1. `emplace-construct` is used to emplace + non-movable types into containers like `tuple`, `optional`, and `variant`. 11.
         template<class... T>

From caa84bbe51fee299aa80f0f829f611bd6323da5f Mon Sep 17 00:00:00 2001
From: Eric Niebler 
Date: Tue, 9 Jan 2024 16:16:16 -0800
Subject: [PATCH 2/3] rename to emplace-from

---
 execution.bs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/execution.bs b/execution.bs
index e2e624e..19a5548 100644
--- a/execution.bs
+++ b/execution.bs
@@ -5010,7 +5010,7 @@ enum class forward_progress_guarantee {
     11. 
         template<callable Fun>
           requires is_nothrow_move_constructible_v<Fun>
-        struct emplace-construct { // exposition only
+        struct emplace-from { // exposition only
           Fun fun; // exposition only
           using type = call-result-t<Fun>;
 
@@ -5024,7 +5024,7 @@ enum class forward_progress_guarantee {
         };
         
- 1. `emplace-construct` is used to emplace + 1. `emplace-from` is used to emplace non-movable types into containers like `tuple`, `optional`, and `variant`. 11.

From 6b8d6965219b4609eb067dc8717f7600bf72f167 Mon Sep 17 00:00:00 2001
From: Eric Niebler 
Date: Tue, 9 Jan 2024 16:20:10 -0800
Subject: [PATCH 3/3] replace emplacer with emplace-from

---
 execution.bs | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/execution.bs b/execution.bs
index 19a5548..d452b17 100644
--- a/execution.bs
+++ b/execution.bs
@@ -5047,19 +5047,6 @@ enum class forward_progress_guarantee {
             structured binding declaration [dcl.struct.bind].
 
     12. 
-        template<callable Fn>
-        struct emplacer { // exposition only
-          Fn fn;  // exposition only
-          operator call-result-t<Fn> () && noexcept(nothrow-callable<Fn>) {
-            return std::move(fn)();
-          }
-        };
-        
- - 1. The type `emplacer` is used to emplace non-movable - types into containers like `tuple`, `optional`, and `variant`. - - 13.
         template <semiregular Tag, movable-value Data = see below, sender... Child>
         constexpr auto make-sender(Tag, Data&& data, Child&&... child);
         
@@ -6408,7 +6395,7 @@ template<class Domain, class Tag, sender Sndr, class... Args> auto sndr2 = apply(std::move(state.fn), args); auto rcvr2 = receiver2{std::move(rcvr), std::move(state.env)}; auto mkop2 = [&] { return connect(std::move(sndr2), std::move(rcvr2)); }; - auto& op2 = state.ops2.emplace<decltype(mkop2())>(emplacer{mkop2}); + auto& op2 = state.ops2.emplace<decltype(mkop2())>(emplace-from{mkop2}); start(op2);