mirror of
https://github.com/nlohmann/json.git
synced 2026-10-29 12:05:22 +00:00
deploy: 94fe31eb9b
This commit is contained in:
@@ -44,7 +44,7 @@ class (either explicitly or via the conversion operators).
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
using nlohmann::json;
|
||||
|
||||
namespace ns
|
||||
{
|
||||
@@ -76,7 +76,7 @@ class (either explicitly or via the conversion operators).
|
||||
|
||||
auto p = j.get<ns::person>();
|
||||
|
||||
std::cout << p.name << " (" << p.age << ") lives in " << p.address << std::endl;
|
||||
std::cout << p.name << " (" << p.age << ") lives in " << p.address << '\n';
|
||||
}
|
||||
|
||||
```
|
||||
@@ -97,7 +97,7 @@ class (either explicitly or via the conversion operators).
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
using nlohmann::json;
|
||||
|
||||
namespace ns
|
||||
{
|
||||
@@ -145,7 +145,7 @@ class (either explicitly or via the conversion operators).
|
||||
|
||||
auto p = j.get<ns::person>();
|
||||
|
||||
std::cout << p.name << " (" << p.age << ") lives in " << p.address << std::endl;
|
||||
std::cout << p.name << " (" << p.age << ") lives in " << p.address << '\n';
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -40,7 +40,7 @@ The example below shows how a `from_json` function can be implemented for a user
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
using nlohmann::json;
|
||||
|
||||
namespace ns
|
||||
{
|
||||
@@ -72,7 +72,7 @@ int main()
|
||||
|
||||
auto p = j.get<ns::person>();
|
||||
|
||||
std::cout << p.name << " (" << p.age << ") lives in " << p.address << std::endl;
|
||||
std::cout << p.name << " (" << p.age << ") lives in " << p.address << '\n';
|
||||
}
|
||||
```
|
||||
|
||||
@@ -90,7 +90,7 @@ The example below shows how a `from_json` is implemented as part of a specializa
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
using nlohmann::json;
|
||||
|
||||
namespace ns
|
||||
{
|
||||
@@ -138,7 +138,7 @@ int main()
|
||||
|
||||
auto p = j.get<ns::person>();
|
||||
|
||||
std::cout << p.name << " (" << p.age << ") lives in " << p.address << std::endl;
|
||||
std::cout << p.name << " (" << p.age << ") lives in " << p.address << '\n';
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -28,7 +28,7 @@ This function is usually called by the constructors of the [basic_json](../basic
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
using nlohmann::json;
|
||||
|
||||
namespace ns
|
||||
{
|
||||
@@ -55,7 +55,7 @@ This function is usually called by the constructors of the [basic_json](../basic
|
||||
|
||||
json j = p;
|
||||
|
||||
std::cout << j << std::endl;
|
||||
std::cout << j << '\n';
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -25,7 +25,7 @@ The example below shows how a `to_json` function can be implemented for a user-d
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
using nlohmann::json;
|
||||
|
||||
namespace ns
|
||||
{
|
||||
@@ -52,7 +52,7 @@ int main()
|
||||
|
||||
json j = p;
|
||||
|
||||
std::cout << j << std::endl;
|
||||
std::cout << j << '\n';
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user