Use json::with_integers_t in the test and the docs
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+3
-4
No files matched your search
@@ -521,8 +521,8 @@ therefore silently changes parse results rather than raising an error. See
|
|||||||
#### Same type for both
|
#### Same type for both
|
||||||
|
|
||||||
`NumberUnsignedType` may be the same type as `NumberIntegerType`, e.g.
|
`NumberUnsignedType` may be the same type as `NumberIntegerType`, e.g.
|
||||||
`#!cpp basic_json<std::map, std::vector, std::string, bool, std::int64_t, std::int64_t, double>`, for code that only
|
`#!cpp nlohmann::json::with_integers_t<std::int64_t, std::int64_t>` (see
|
||||||
wants to handle one integer type. Such a `basic_json` stores every integer as
|
[`with_integers_t`](../../api/basic_json/with_t.md)), for code that only wants to handle one integer type. Such a `basic_json` stores every integer as
|
||||||
[`number_integer_t`](../../api/basic_json/number_integer_t.md):
|
[`number_integer_t`](../../api/basic_json/number_integer_t.md):
|
||||||
|
|
||||||
- [`is_number_unsigned()`](../../api/basic_json/is_number_unsigned.md) is always `#!cpp false`, and
|
- [`is_number_unsigned()`](../../api/basic_json/is_number_unsigned.md) is always `#!cpp false`, and
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <map>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -24,7 +23,7 @@ namespace
|
|||||||
{
|
{
|
||||||
|
|
||||||
template<typename IntegerType>
|
template<typename IntegerType>
|
||||||
using same_types_json = nlohmann::basic_json<std::map, std::vector, std::string, bool, IntegerType, IntegerType, double>;
|
using same_types_json = nlohmann::json::with_integers_t<IntegerType, IntegerType>;
|
||||||
|
|
||||||
using json64 = same_types_json<std::int64_t>;
|
using json64 = same_types_json<std::int64_t>;
|
||||||
using json32 = same_types_json<std::int32_t>;
|
using json32 = same_types_json<std::int32_t>;
|
||||||
|
|||||||
Reference in new issue
Block a user