mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-02 00:00:26 +02:00
Shamelessly copy Josiah
This commit is contained in:
16
source/lib/json/docs/examples/rbegin.cpp
Normal file
16
source/lib/json/docs/examples/rbegin.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create an array value
|
||||
json array = {1, 2, 3, 4, 5};
|
||||
|
||||
// get an iterator to the reverse-beginning
|
||||
json::reverse_iterator it = array.rbegin();
|
||||
|
||||
// serialize the element that the iterator points to
|
||||
std::cout << *it << '\n';
|
||||
}
|
Reference in New Issue
Block a user