✏️ fix links
This commit is contained in:
parent
d523f0c4bc
commit
d76b8b0201
@ -77,7 +77,7 @@ Some important things:
|
||||
* Those methods **MUST** be in your type's namespace (which can be the global namespace), or the library will not be able to locate them (in this example, they are in namespace `ns`, where `person` is defined).
|
||||
* Those methods **MUST** be available (e.g., proper headers must be included) everywhere you use these conversions. Look at [issue 1108](https://github.com/nlohmann/json/issues/1108) for errors that may occur otherwise.
|
||||
* When using `get<your_type>()`, `your_type` **MUST** be [DefaultConstructible](https://en.cppreference.com/w/cpp/named_req/DefaultConstructible). (There is a way to bypass this requirement described later.)
|
||||
* In function `from_json`, use function [`at()`](https://nlohmann.github.io/json/classnlohmann_1_1basic__json_a93403e803947b86f4da2d1fb3345cf2c.html#a93403e803947b86f4da2d1fb3345cf2c) to access the object values rather than `operator[]`. In case a key does not exist, `at` throws an exception that you can handle, whereas `operator[]` exhibits undefined behavior.
|
||||
* In function `from_json`, use function [`at()`](../api/basic_json/at.md) to access the object values rather than `operator[]`. In case a key does not exist, `at` throws an exception that you can handle, whereas `operator[]` exhibits undefined behavior.
|
||||
* You do not need to add serializers or deserializers for STL types like `std::vector`: the library already implements these.
|
||||
|
||||
|
||||
|
||||
@ -275,7 +275,7 @@ The rationale is twofold:
|
||||
|
||||
### Determine number types
|
||||
|
||||
As the example in [Number conversion](#number_conversion) shows, there are different functions to determine the type of
|
||||
As the example in [Number conversion](#number-conversion) shows, there are different functions to determine the type of
|
||||
the stored number:
|
||||
|
||||
- [`is_number()`](../../api/basic_json/is_number.md) returns `#!c true` for any number type
|
||||
|
||||
Loading…
Reference in New Issue
Block a user