Skip to content

Add return value conversion for QCoroTask#264

Merged
danvratil merged 1 commit intoqcoro:mainfrom
rsp4jack:main
Feb 8, 2025
Merged

Add return value conversion for QCoroTask#264
danvratil merged 1 commit intoqcoro:mainfrom
rsp4jack:main

Conversation

@rsp4jack
Copy link
Contributor

const auto testcoro [[maybe_unused]] = []() -> QCoro::Task<int> {
    co_return 42LL;
};

As mValue is std::variant<std::monostate, T, std::exception_ptr>, narrowing conversion will not happen without explicit conversion.

BTW template<typename U> requires /*...*/ void return_value(U &&value) noexcept The U&& is a universal reference, so the unnecessary const U& value reload is removed.

Copy link
Collaborator

@danvratil danvratil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@danvratil danvratil merged commit 0282315 into qcoro:main Feb 8, 2025
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants