Defined in header <fkYAML/node.hpp>
fkyaml::basic_node::end, fkyaml::basic_node::cend¶
Returns a (constant) iterator to the past-the-last 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 past-the-last 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 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: