-
Notifications
You must be signed in to change notification settings - Fork 274
Add lazy
function with auto inferred type
#5101
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
Add lazy
function with auto inferred type
#5101
Conversation
63147b4
to
4ecb39d
Compare
4ecb39d
to
0ac36d2
Compare
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 0ac36d2).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/126576035
Codecov Report
@@ Coverage Diff @@
## develop #5101 +/- ##
===========================================
+ Coverage 69.69% 69.69% +<.01%
===========================================
Files 1321 1321
Lines 109346 109360 +14
===========================================
+ Hits 76205 76219 +14
Misses 33141 33141
Continue to review full report at Codecov.
|
unit/util/lazy.cpp
Outdated
auto lazy_length = | ||
lazyt<int>::from_fun([&]() { return length_with_counter("foo"); }); | ||
lazyt<std::size_t> lazy_length = | ||
lazy([&] { return length_with_counter("foo"); }); |
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.
Why re-purpose a unit test?
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.
no good reason, I've now added this one as a new scenario instead.
0ac36d2
to
a6b952c
Compare
This allow to write `lazy(f)` and get the type of the object automatically inferred from the type of `f`.
a6b952c
to
d5e6b59
Compare
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: d5e6b59).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/126620423
This allow to write
lazy(f)
and get the type of the objectautomatically inferred from the type of
f
.