C++C++11C++14C++17Iterators

The Move Iterator Adapter in C++

The dereference prefix operator * being applied to iterator returns the lvalue reference to the element pointed by the iterator. Therefore, algorithms such as std::copy or std::transform calls copying constructors of processed elements, for example: #include <algorithm> #include <list> #include <string> #include <vector> auto deep_copy_to_list(const…
Read more
C++C++11C++14C++17IteratorsLearn C++

Categories of Iterators in C++

Conceptually, iterators are consists of five categories: input iterator is intended to traverse sequences in the forward direction and provides the read access to the pointed sequence element;output iterator is intended to traverse sequences in the forward direction and provides the write access to the pointed sequence element;forward iterator is intended to traverse sequences in the forward…
Read more