Index: source/ps/Future.h =================================================================== --- source/ps/Future.h +++ source/ps/Future.h @@ -318,7 +318,8 @@ template PackagedTask Future::Wrap(T&& func) { - static_assert(std::is_convertible_v, ResultType>, "The return type of the wrapped function cannot be converted to the type of the Future."); + static_assert(std::is_same_v, ResultType>, + "The return type of the wrapped function is not the same as the type of the Future."); m_SharedState = std::make_shared(std::move(func)); return PackagedTask(m_SharedState); } Index: source/ps/tests/test_Future.h =================================================================== --- source/ps/tests/test_Future.h +++ source/ps/tests/test_Future.h @@ -54,14 +54,6 @@ TS_ASSERT_EQUALS(future.Get(), 1); } - // Convertible type. - { - Future future; - std::function task = future.Wrap([]() -> u8 { return 1; }); - task(); - TS_ASSERT_EQUALS(future.Get(), 1); - } - static int destroyed = 0; // No trivial constructor or destructor. Also not copiable. struct NonDef @@ -80,14 +72,14 @@ TS_ASSERT_EQUALS(destroyed, 0); { Future future; - std::function task = future.Wrap([]() { return 1; }); + std::function task = future.Wrap([]() { return NonDef{1}; }); task(); TS_ASSERT_EQUALS(future.Get().value, 1); } TS_ASSERT_EQUALS(destroyed, 1); { Future future; - std::function task = future.Wrap([]() { return 1; }); + std::function task = future.Wrap([]() { return NonDef{1}; }); } TS_ASSERT_EQUALS(destroyed, 1); /**