Defined in header <fkYAML/node.hpp>
fkyaml::basic_node::end¶
Returns an iterator to the past-the-last element of a container node value.
Throws a fkyaml::exception
if a basic_node does not have a sequence nor mapping value.
Return Value¶
An iterator to the past-the-last element of a container node value (either sequence or mapping).
Example
#include <iostream>
#include <fkYAML/node.hpp>
int main() {
// create a sequence node.
fkyaml::node n = {"foo", "bar"};
// get an iterator to the past-the-last element.
fkyaml::node::iterator it = n.end();
// decrement the iterator to point to the last element.
--it;
std::cout << *it << std::endl;
return 0;
}
output: