Skip to content

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

Merged
merged 1 commit into from
Sep 10, 2019

Conversation

romainbrenguier
Copy link
Contributor

This allow to write lazy(f) and get the type of the object
automatically inferred from the type of f.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • [na] The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • [na] My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • [na] White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Copy link
Contributor

@allredj allredj left a 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-io
Copy link

codecov-io commented Sep 10, 2019

Codecov Report

Merging #5101 into develop will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #5101      +/-   ##
===========================================
+ Coverage    69.69%   69.69%   +<.01%     
===========================================
  Files         1321     1321              
  Lines       109346   109360      +14     
===========================================
+ Hits         76205    76219      +14     
  Misses       33141    33141
Impacted Files Coverage Δ
src/util/lazy.h 100% <ø> (ø) ⬆️
unit/util/lazy.cpp 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b4de42...d5e6b59. Read the comment docs.

auto lazy_length =
lazyt<int>::from_fun([&]() { return length_with_counter("foo"); });
lazyt<std::size_t> lazy_length =
lazy([&] { return length_with_counter("foo"); });
Copy link
Contributor

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?

Copy link
Contributor Author

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.

This allow to write `lazy(f)` and get the type of the object
automatically inferred from the type of `f`.
Copy link
Contributor

@allredj allredj left a 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

@romainbrenguier romainbrenguier merged commit 502f5ff into diffblue:develop Sep 10, 2019
@romainbrenguier romainbrenguier deleted the feature/lazy branch September 10, 2019 13:55
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.

5 participants