mirror of
https://github.com/nlohmann/json.git
synced 2024-08-23 21:42:29 +02:00
20 lines
339 B
C++
20 lines
339 B
C++
|
#include <iostream>
|
||
|
#include <nlohmann/json.hpp>
|
||
|
|
||
|
using json = nlohmann::json;
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
// different JSON Pointers
|
||
|
json::json_pointer ptr1("/foo/0");
|
||
|
json::json_pointer ptr2("/a~1b");
|
||
|
|
||
|
// implicit conversion to string
|
||
|
std::string s;
|
||
|
s += ptr1;
|
||
|
s += "\n";
|
||
|
s += ptr2;
|
||
|
|
||
|
std::cout << s << std::endl;
|
||
|
}
|