This commit is contained in:
nlohmann committed 2026-10-26 21:24:35 +00:00
1 parent 41c601a7d1
commit d2e264bd84
1400 files changed
+11859 -5440

No files matched your search

+8 -8
View File
@@ -65,7 +65,7 @@ The example shows the serialization of a JSON value to a byte vector in UBJSON f
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using nlohmann::json;
using namespace nlohmann::literals;
// function to print UBJSON's diagnostic format
@@ -73,11 +73,11 @@ void print_byte(uint8_t byte)
{
if (32 < byte and byte < 128)
{
std::cout << (char)byte;
std::cout << static_cast<char>(byte);
}
else
{
std::cout << (int)byte;
std::cout << static_cast<int>(byte);
}
}
@@ -94,7 +94,7 @@ int main()
{
print_byte(byte);
}
std::cout << std::endl;
std::cout << '\n';
// create an array of numbers
json array = {1, 2, 3, 4, 5, 6, 7, 8};
@@ -111,19 +111,19 @@ int main()
{
print_byte(byte);
}
std::cout << std::endl;
std::cout << '\n';
for (auto& byte : v_array_size)
{
print_byte(byte);
}
std::cout << std::endl;
std::cout << '\n';
for (auto& byte : v_array_size_and_type)
{
print_byte(byte);
}
std::cout << std::endl;
std::cout << '\n';
}
```
@@ -144,7 +144,7 @@ The example shows how requesting type annotations (`use_type`) without size anno
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using nlohmann::json;
int main()
{