#includeIn this example, the `hasNext()` function is implicitly called by the `it != v.end()` comparison in the while loop. It will return `false` when all elements in the vector have been traversed. The `hasNext()` function is part of the C++ Standard Library, and is available in the `#include int main() { std::vector v = {1, 2, 3, 4, 5}; auto it = v.begin(); while (it != v.end()) { std::cout << *it << " "; ++it; } std::cout << std::endl; return 0; }