nlohmann / json

JSON for Modern C++
https://json.nlohmann.me
MIT License
42.4k stars 6.67k forks source link

Explicit conversion example in docs should use `template get` #4038

Closed tusooa closed 1 year ago

tusooa commented 1 year ago

Description

Follow up of https://github.com/nlohmann/json/issues/3827 .

As get<>() may not always work, the documentation SHOULD use template get<>() instead of get<>() in the examples to avoid confusion.

Reproduction steps

use the explicit conversion described in the example

Expected vs. actual results

expected: works

actual: compilation failure

Minimal code example

No response

Error messages

No response

Compiler and operating system

g++ 12 on GNU/Linux

Library version

3.11.2

Validation