mirror of
https://github.com/nlohmann/json.git
synced 2026-04-19 22:39:28 +00:00
deploy: 44bee1b138
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
/* Demonstration of type error exception with diagnostic postions support enabled */
|
||||
/* Demonstration of type error exception with diagnostic positions support enabled */
|
||||
int main()
|
||||
{
|
||||
//Invalid json string - housenumber type must be int instead of string
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
/* Demonstration of type error exception with diagnostic postions support enabled */
|
||||
/* Demonstration of type error exception with diagnostic positions support enabled */
|
||||
int main()
|
||||
{
|
||||
//Invalid json string - housenumber type must be int instead of string
|
||||
|
||||
@@ -5,7 +5,7 @@ using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create JSON poiner
|
||||
// create JSON pointer
|
||||
json::json_pointer ptr("/foo/bar/baz");
|
||||
|
||||
// write string representation to stream
|
||||
|
||||
@@ -10,5 +10,5 @@ int main()
|
||||
std::cout << "operator[]: " << j["uint64"] << '\n'
|
||||
<< "default value (int): " << j.value("uint64", 0) << '\n'
|
||||
<< "default value (uint64_t): " << j.value("uint64", std::uint64_t(0)) << '\n'
|
||||
<< "explict return value type: " << j.value<std::uint64_t>("uint64", 0) << '\n';
|
||||
<< "explicit return value type: " << j.value<std::uint64_t>("uint64", 0) << '\n';
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
operator[]: 18446744073709551615
|
||||
default value (int): -1
|
||||
default value (uint64_t): 18446744073709551615
|
||||
explict return value type: 18446744073709551615
|
||||
explicit return value type: 18446744073709551615
|
||||
|
||||
Reference in New Issue
Block a user