Check out example codes for "std::reverse". It will help you in understanding the concepts better.

Code Example 1

std::vector<int> v{1,2,3};
    std::reverse(std::begin(v), std::end(v));

Learn ReactJs, React Native from akashmittal.com