Skip to content
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

regression: .value<size_t> is compilation error. #3655

Closed
2 tasks
alex-700 opened this issue Aug 2, 2022 · 2 comments · Fixed by #3663
Closed
2 tasks

regression: .value<size_t> is compilation error. #3655

alex-700 opened this issue Aug 2, 2022 · 2 comments · Fixed by #3663
Labels
confirmed kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@alex-700
Copy link

alex-700 commented Aug 2, 2022

Description

While calling .value<size_t>, the code requests instantiation of json_pointer<size_t> which leads to compilation error, because of ambiguity between /=(string_t) and /=(size_t).

Reproduction steps

https://godbolt.org/z/WYKW7hYeY

Expected vs. actual results

Code must compiles, as in 3.10.5.

Minimal code example

#include <nlohmann/json.hpp>

int main() 
{
    nlohmann::json().value<size_t>("key", 0);
}

Error messages

No response

Compiler and operating system

archlinux, gcc-12.1

Library version

3.11.1

Validation

@falbrechtskirchinger
Copy link
Contributor

Confirmed. Compiles with v3.10.5, fails with develop.

@xvitaly
Copy link
Contributor

xvitaly commented Aug 3, 2022

Can confirm on Fedora 37 with 3.11.1.

@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Aug 5, 2022
@nlohmann nlohmann added this to the Release 3.11.2 milestone Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
4 participants