From d87dfa14c806e5165c2d988e9d05c07ca7c094c1 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Thu, 4 Jan 2024 09:01:04 -0800 Subject: [PATCH] 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>