Defined in header <fkYAML/node.hpp>
fkyaml::basic_node::rend, fkyaml::basic_node::crend¶
Returns a (constant) iterator to the reverse-end (= one before the first) element of a container node.
Throws a fkyaml::type_error
if a basic_node is neither a sequence nor mapping node.
Return Value¶
A (constant) iterator to the reverse-end (= one before 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 reverse-end (= one before the first) element.
fkyaml::node::reverse_iterator it = n.rend();
// decrement the iterator to point to the first element.
--it;
std::cout << *it << std::endl;
return 0;
}
output: