Quick Q: What is move_iterator for?
Quick A: To enabling moving out of *iterator.
Recently on SO:
What is move_iterator for?
If I understand it correct,
a=std::move(b)binds reference a to the address of b. And after this operation the content that b points to is not guaranteed.The implementation of
move_iteratorhere has this lineauto operator[](difference_type n) const -> decltype(std::move(current[n])) { return std::move(current[n]); }However, I don't think it makes sense to
std::movean element in an array. What happens ifa=std::move(b[n])?The following example confuses me also:
std::string concat = std::accumulate( std::move_iterator<iter_t>(source.begin()), std::move_iterator<iter_t>(source.end()), std::string("1234"));Since the concat will itself allocate a continuous chunk of memory to store the result, which will not have any overlap with source. The data in source will be copied to concat but not moved.

Did you you know that...
Sasha Goldshtein shares with us his thoughts about the
A new post on iterators:
While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature: