diff --git a/include/CoroutineTests/alien/algorithm.hpp b/include/CoroutineTests/alien/algorithm.hpp index 06cbe9b..c74a842 100644 --- a/include/CoroutineTests/alien/algorithm.hpp +++ b/include/CoroutineTests/alien/algorithm.hpp @@ -115,6 +115,10 @@ struct Task::promise_type { void return_value(T&& value) { m_promise.set_value(std::forward(value)); } + // Overload to resolve ambiguity + void return_value(ResultType value) { + m_promise.set_value(std::move(value)); + } }; template diff --git a/include/CoroutineTests/alien/manual_algorithm.hpp b/include/CoroutineTests/alien/manual_algorithm.hpp index 1a44d3a..16b8d22 100644 --- a/include/CoroutineTests/alien/manual_algorithm.hpp +++ b/include/CoroutineTests/alien/manual_algorithm.hpp @@ -113,6 +113,8 @@ struct Task::promise_type { void return_value(T&& value) { m_value = std::forward(value); } + // Overload to resolve ambiguity + void return_value(ResultType value) { m_value.emplace(std::move(value)); } }; template diff --git a/include/CoroutineTests/alien/subtool.hpp b/include/CoroutineTests/alien/subtool.hpp index f394228..43a18e8 100644 --- a/include/CoroutineTests/alien/subtool.hpp +++ b/include/CoroutineTests/alien/subtool.hpp @@ -117,6 +117,8 @@ struct ReturnHelper { void return_value(T&& value) { m_value.emplace(std::forward(value)); } + // Overload to resolve ambiguity + void return_value(ResultType value) { m_value.emplace(std::move(value)); } }; // Specialization for void return type diff --git a/include/CoroutineTests/alien/tool.hpp b/include/CoroutineTests/alien/tool.hpp index 8a50379..4e4b033 100644 --- a/include/CoroutineTests/alien/tool.hpp +++ b/include/CoroutineTests/alien/tool.hpp @@ -117,6 +117,8 @@ struct ReturnHelper { void return_value(T&& value) { m_value.emplace(std::forward(value)); } + // Overload to resolve ambiguity + void return_value(ResultType value) { m_value.emplace(std::move(value)); } }; // Specialization for void return type