Skip to content

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

Closed
@alex-700

Description

@alex-700

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions