Initial import of libdpf.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
e4e666f459
4563 changed files with 1690372 additions and 0 deletions
25
thirdparty/json/docs/examples/push_back__object_t__value.cpp
vendored
Normal file
25
thirdparty/json/docs/examples/push_back__object_t__value.cpp
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create JSON values
|
||||
json object = {{"one", 1}, {"two", 2}};
|
||||
json null;
|
||||
|
||||
// print values
|
||||
std::cout << object << '\n';
|
||||
std::cout << null << '\n';
|
||||
|
||||
// add values
|
||||
object.push_back(json::object_t::value_type("three", 3));
|
||||
object += json::object_t::value_type("four", 4);
|
||||
null += json::object_t::value_type("A", "a");
|
||||
null += json::object_t::value_type("B", "b");
|
||||
|
||||
// print values
|
||||
std::cout << object << '\n';
|
||||
std::cout << null << '\n';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue