Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow move-only types in Promise<>. (based on contribution from jb-gcx) #180

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

li-feng-sc
Copy link
Contributor

@li-feng-sc li-feng-sc commented Jul 15, 2024

A slight variation of the original fix from @jb-gcx #177

Copy link
Contributor

@jb-gcx jb-gcx left a comment

Choose a reason for hiding this comment

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

I don't quite agree with your worry about returning a reference, but this solution fits my needs as well. Thank you for investing the time 🙏

@@ -57,6 +57,7 @@ struct ValueHolder {
using type = T;
std::optional<T> value;
T getValueUnsafe() const {return *value;}
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I see this is unused now and can be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right the const version can go

@li-feng-sc li-feng-sc merged commit 5466945 into main Jul 16, 2024
1 check passed
@li-feng-sc li-feng-sc deleted the lf/move-only-promise branch July 16, 2024 02:06
@jb-gcx jb-gcx mentioned this pull request Jul 24, 2024
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.

3 participants