How to convert const_iterators to iterators using std::distance and std::advance
A short posting demonstrating how to remove the const-ness of a const_iterator, given that it is not possible to use re-casting along the lines of const_cast to convert from const_iterator to iterator. Consider the following example: Which results in the following compilation error: error C2440: ‘initializing’ : cannot convert from ‘std::_Vector_const_iterator’ to ‘std::_Vector_iterator’ One approach, …