This commit is contained in:
nlohmann committed 2026-10-12 07:35:31 +00:00
1 parent 79119509a9
commit 22fba27145
555 files changed
+17342 -1394

No files matched your search

+19 -2
View File
@@ -50,13 +50,30 @@ Linear.
The following code shows how to create JSON values from string literals.
```cpp
--8<-- "examples/operator_literal_json.cpp"
#include <iostream>
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using namespace nlohmann::literals;
int main()
{
json j = R"( {"hello": "world", "answer": 42} )"_json;
std::cout << std::setw(2) << j << '\n';
}
```
Output:
```json
--8<-- "examples/operator_literal_json.output"
{
"answer": 42,
"hello": "world"
}
```
## See also