The Move Iterator Adapter in C++
December 6, 2020
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…