C++C++11C++14C++17Generic ProgrammingIteratorsLearn C++

Helpers for Generic C++ Code Iterating Over Sequences

The iterator library that is part of the C++ Standard Library provides the following helpers for writing generic code: #include <iterator> // helpers are defined here template<class Container> void foo(Container& c) { // Generic way to obtain (constant) iterators auto b = std::begin(c); // (1) auto cb = std::cbegin(c); // (2) auto e = std::end(c); //…
Read more