mirror of
https://github.com/nlohmann/json.git
synced 2026-10-04 21:50:33 +00:00
deploy: 63c10a51fc
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create a non-empty JSON array
|
||||
json j = {1, 2, 3};
|
||||
|
||||
// exception other_error.502
|
||||
try
|
||||
{
|
||||
json::to_ubjson(j, false, true);
|
||||
}
|
||||
catch (const json::other_error& e)
|
||||
{
|
||||
std::cout << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user