Sha256: 44f211d892ddd36521c8d567fdd60d568ea22d98af79c2649abf5534223e11a4

Contents?: true

Size: 547 Bytes

Versions: 1

Compression:

Stored size: 547 Bytes

Contents

#include <iostream>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

int main()
{
    // create a JSON object
    json j_object = {{"one", 1}, {"two", 2}};

    // call find
    auto it_two = j_object.find("two");
    auto it_three = j_object.find("three");

    // print values
    std::cout << std::boolalpha;
    std::cout << "\"two\" was found: " << (it_two != j_object.end()) << '\n';
    std::cout << "value at key \"two\": " << *it_two << '\n';
    std::cout << "\"three\" was found: " << (it_three != j_object.end()) << '\n';
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simdjson-0.3.0 vendor/simdjson/dependencies/json/doc/examples/find__key_type.cpp