Skip to content

Defined in header <fkYAML/node.hpp>

fkyaml::node

using node = basic_node<>;

This type is the default specialization of the basic_node class which uses the standard template types.

Example
#include <iostream>
#include <fkYAML/node.hpp>

int main() {
    // create a YAML node.
    fkyaml::node n = {{"foo", 3.14}, {"bar", true}, {"baz", nullptr}, {"qux", {{"corge", {1, 2, 3}}}}};

    // add a new value.
    n["qux"]["key"] = {"another", "value"};

    // output a YAML formatted string.
    std::cout << n << std::endl;
}

output:

bar: true
baz: null
foo: 3.14
qux:
  corge:
    - 1
    - 2
    - 3
  key:
    - another
    - value

See Also