-
Notifications
You must be signed in to change notification settings - Fork 67
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
Async ref #81
Async ref #81
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #81 +/- ##
===========================================
+ Coverage 94.74% 94.83% +0.09%
===========================================
Files 33 34 +1
Lines 4206 4280 +74
Branches 214 214
===========================================
+ Hits 3985 4059 +74
Misses 85 85
Partials 136 136
Continue to review full report at Codecov.
|
auto p = package<result_type()>( | ||
executor, std::bind<result_type>( | ||
[_f = std::forward<F>(f)](unwrap_reference_t<std::decay_t<Args>> & | ||
... args) mutable->result_type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line wrapping here is strange. Probably a result of clangformat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, clang-format is getting lost on that line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes are fine for me. But I think we should add a test for this as well so that we will have this as regression as well.
You guys are efficient! Note I think this also addresses |
I will add some test cases. #include <stlab/concurrency/future.hpp>
#include <stlab/concurrency/immediate_executor.hpp>
#include <stlab/test/model.hpp>
int main() {
stlab::annotate a;
stlab::async(stlab::immediate_executor, [](const auto& x) -> const auto& { return x; },
std::cref(a));
} |
I added test cases and reworked annotate to make it more useful for generating tests. See the new future tests for async to see how to use it. |
@FelixPetriconi - can you take a look at this? Added support for std::ref per issue #80. Required quite a bit of meta- scaffolding.