-
-
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
wrong enable_if for const pointer (instead of pointer-to-const) #134
Labels
Comments
dariomt
added a commit
to dariomt/json
that referenced
this issue
Oct 16, 2015
The intention of the current code is to detect a pointer-to-const but instead it is detecting a const-pointer. See nlohmann#134
PR #137 ready! |
After merging #137, this issue can be closed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi ,
The following test fails to compile:
But this compiles (note the extra const):
I think that the problem is the additional check for the const overload of get_ptr
and std::is_const<PointerType>::value
I think what you intended was to check that the template parameter is a "pointer-to-const" but what you are actually checking is if you got a "const pointer".
I believe the right fix is to check for "pointer-to-const" like this:
and std::is_const< typename std::remove_pointer<PointerType>::type >::value
It works in VS2015.
The text was updated successfully, but these errors were encountered: