-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Rework INFO
lazy evaluation to use lambdas.
#270
Conversation
Instead of capturing everything by pointer, we capture the given expression into a lazily evaluated lambda which we store as a reference. This allows passing any expression to `INFO` including rvalues.
I can't reproduce the Appveyor failure locally and the Appveyor debug logs aren't exactly helpful. (Btw, you might want to apply for the Github actions beta (https://github.com/features/actions). If it turns out to be any good I'll likely move reproc's CI entirely to that and might do the same for doctest if it supports all necessary features). |
I just noticed in the appveyor log that it is instantiating maybe the decltype is the problem... we might experiment with passing the lambda by value instead of by reference... like here (without the perfect forwarding): https://stackoverflow.com/a/10270809/3162383 I could test it locally at home with MSVC. I signed up for Actions, thanks. |
This avoids conflicts with outer scope variables (which are all captured by reference).
Use function template argument deduction via `MakeContextScope` instead of `decltype` to declare instances of `ContextScope` in `DOCTEST_CONFIG_IMPL`.
Seems like MSVC just didn't like |
I guess clang will again complain about the extra semicolon in some places: apart from that - this will probably work! |
We don't remove the actual macro to keep backwards compatibility.
I made |
That last commit only updates documentation so you don't necessarily have to wait for the entire build to complete again. The previous build completed successfully. |
Mostly removal of constraints that can now be relaxed.
good work - thanks for this! :) |
Instead of capturing everything by pointer, we capture the given
expression into a lazily evaluated lambda which we store as a reference.
This allows passing any expression to
INFO
including rvalues.Fixes #269.
There's probably more code that can be removed but I wanted to get the initial version out there.