Made Future::set() only callable on futures with void result to prevent futures that are ready but have no result.

This commit is contained in:
Patrick 2024-11-12 23:31:43 +01:00
parent 7dcdf2df22
commit 2af1b5edd5

View File

@ -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<TValue, void>)
{
MIJIN_ASSERT(!isSet_, "Trying to set a future twice!");
isSet_ = true;