mirror of
https://github.com/nlohmann/json.git
synced 2026-10-28 19:45:22 +00:00
deploy: 4155e2938f
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json_view.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << std::boolalpha;
|
||||
|
||||
// the default constructor is the only public one: it creates an invalid
|
||||
// (discarded) view, useful as a "no value yet" placeholder
|
||||
nlohmann::json_view v;
|
||||
std::cout << v.is_discarded() << '\n';
|
||||
|
||||
// views are trivially copyable handles (two pointers); the document owns
|
||||
// the actual data
|
||||
nlohmann::json_view copy = v;
|
||||
std::cout << copy.is_discarded() << '\n';
|
||||
}
|
||||
Reference in New Issue
Block a user