-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Move lambda out of unevaluated context #1230
Move lambda out of unevaluated context #1230
Conversation
@@ -320,15 +320,18 @@ class input_adapter | |||
int>::type = 0> | |||
input_adapter(IteratorType first, IteratorType last) | |||
{ | |||
#ifdef DEBUG |
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.
I am sorry, I wrote it wrong in the original issue. This should be #ifndef NDEBUG
, see https://en.cppreference.com/w/cpp/error/assert.
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.
Ah, that's what I thought, should have asked. Brb then!
e234a17
to
6b5334c
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.
Looks good to me.
Thanks a lot! |
Thank you for the great lib! |
Fixes #1225.
As per issue #1225, the lambda has been moved out of the assert to prevent the "lambda-expression in unevaluated context" error that is present with older compilers, and has been wrapped in an
#ifdef DEBUG
directive to keep production and debug builds the same.Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filesingle_include/nlohmann/json.hpp
. The whole process is described here.Please don't
#ifdef
s or other means.