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

Fix issue #229 #232

Merged
merged 1 commit into from
Jan 27, 2019
Merged

Fix issue #229 #232

merged 1 commit into from
Jan 27, 2019

Conversation

FelixPetriconi
Copy link
Member

No description provided.

@FelixPetriconi FelixPetriconi merged commit 5852f3b into stlab:develop Jan 27, 2019
}

template <typename T>
template <typename R>
auto shared_base<T, enable_if_not_copyable<T>>::reduce(future<future<R>>&& r) -> future<R> {
return std::move(r).then([](auto&& f) { return *std::forward<future<R>>(f).get_try(); });
return std::move(r).then([](auto&& f) { return *std::move(f).get_try(); });
Copy link
Member

Choose a reason for hiding this comment

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

@FelixPetriconi - can you speak a little bit to why you made this change? I would have thought the correct line here would be std::forward<decltype(f)>(f)... why is a move correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

My mistake. I was looking at the signature from the reduce function and there it is an rvalue reference, that should be moved. But here, as you correctly have noticed, we are in a forwarding reference and your code would be the general solution to this. I will fix this now.

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