Defined in header <fkYAML/node.hpp>
fkyaml::basic_node::begin, fkyaml::basic_node::cbegin¶
Returns a (constant) iterator to the first element of a container node.
If a basic_node is neither a sequence nor mapping, a fkyaml::type_error
will be thrown.
Return Value¶
A (constant) iterator to the first element of a container node.
Examples¶
Example
#include <iostream>
#include <fkYAML/node.hpp>
int main() {
// create a sequence node.
fkyaml::node n = {"foo", "bar"};
// get an iterator to the first element.
fkyaml::node::iterator it = n.begin();
std::cout << *it << std::endl;
return 0;
}
output: