This commit is contained in:
nlohmann
2025-09-16 06:08:09 +00:00
parent 0b14a60e6f
commit fab37adabc
247 changed files with 506 additions and 506 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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';
}

View File

@@ -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