From 2af1b5edd59eaff4396e1028b6a94fcb0c235e3d Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Tue, 12 Nov 2024 23:31:43 +0100 Subject: [PATCH] Made Future::set() only callable on futures with void result to prevent futures that are ready but have no result. --- source/mijin/async/future.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mijin/async/future.hpp b/source/mijin/async/future.hpp index 5297ff7..ec59bbc 100644 --- a/source/mijin/async/future.hpp +++ b/source/mijin/async/future.hpp @@ -113,7 +113,7 @@ public: // modification isSet_ = true; sigSet.emit(); } - constexpr void set() MIJIN_NOEXCEPT + constexpr void set() MIJIN_NOEXCEPT requires (std::is_same_v) { MIJIN_ASSERT(!isSet_, "Trying to set a future twice!"); isSet_ = true;