rbegin.cpp 343 B

12345678910111213141516
  1. #include <iostream>
  2. #include <nlohmann/json.hpp>
  3. using json = nlohmann::json;
  4. int main()
  5. {
  6. // create an array value
  7. json array = {1, 2, 3, 4, 5};
  8. // get an iterator to the reverse-beginning
  9. json::reverse_iterator it = array.rbegin();
  10. // serialize the element that the iterator points to
  11. std::cout << *it << '\n';
  12. }