deploy: 63c10a51fc
This commit is contained in:
1 parent
2aaa1d24ef
commit
a410b4f40f
741 files changed
+8115
-2252
No files matched your search
@@ -0,0 +1,23 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create a JSON object whose key contains a null byte (U+0000)
|
||||
std::string key = "ab";
|
||||
key.push_back('\0');
|
||||
key.push_back('c');
|
||||
json j = {{key, 1}};
|
||||
|
||||
// exception out_of_range.409
|
||||
try
|
||||
{
|
||||
json::to_bson(j);
|
||||
}
|
||||
catch (const json::out_of_range& e)
|
||||
{
|
||||
std::cout << e.what() << '\n';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user