Clarify documentation

This commit is contained in:
Florian Albrechtskirchinger 2022-08-01 19:38:36 +02:00
parent 961a8e6b39
commit fdc8e6ea79
No known key found for this signature in database
GPG Key ID: 19618CE9B2D4BE6D
2 changed files with 8 additions and 6 deletions

View File

@ -7,16 +7,17 @@ json operator "" _json(const char* s, std::size_t n);
This operator implements a user-defined string literal for JSON objects. It can be used by adding `#!cpp _json` to a
string literal and returns a [`json`](json.md) object if no parse error occurred.
Use any of the following lines to bring the operator into scope:
It is recommended to bring the operator into scope using any of the following lines:
```cpp
using nlohmann::literals::operator "" _json;
using namespace nlohmann::literals;
using namespace nlohmann::json_literals;
using namespace nlohmann::literals::json_literals;
using namespace nlohmann;
```
This is suggested to ease migration to the next major version release of the library.
See ['JSON_USE_GLOBAL_UDLS`](macros/json_use_global_udls.md#notes) for details.
Alternatively, define [`JSON_USE_GLOBAL_UDLS`](macros/json_use_global_udls.md) to make them available in the global
namespace.
## Parameters
`s` (in)

View File

@ -7,16 +7,17 @@ json_pointer operator "" _json_pointer(const char* s, std::size_t n);
This operator implements a user-defined string literal for JSON Pointers. It can be used by adding `#!cpp _json_pointer`
to a string literal and returns a [`json_pointer`](json_pointer/index.md) object if no parse error occurred.
Use any of the following lines to bring the operator into scope:
It is recommended to bring the operator into scope using any of the following lines:
```cpp
using nlohmann::literals::operator "" _json_pointer;
using namespace nlohmann::literals;
using namespace nlohmann::json_literals;
using namespace nlohmann::literals::json_literals;
using namespace nlohmann;
```
This is suggested to ease migration to the next major version release of the library.
See ['JSON_USE_GLOBAL_UDLS`](macros/json_use_global_udls.md#notes) for details.
Alternatively, define [`JSON_USE_GLOBAL_UDLS`](macros/json_use_global_udls.md) to make them available in the global
namespace.
## Parameters
`s` (in)