00001 #include <json.hpp> 00002 00003 using json = nlohmann::json; 00004 00005 int main() 00006 { 00007 // create an array value 00008 json array = {1, 2, 3, 4, 5}; 00009 00010 // get am iterator to one past the last element 00011 json::const_iterator it = array.cend(); 00012 00013 // decrement the iterator to point to the last element 00014 --it; 00015 00016 // serialize the element that the iterator points to 00017 std::cout << *it << '\n'; 00018 }