Is a back_insert_iterator valid for the lifetime of the container?
I think I know the answer to this, but I’d appreciate a sanity check.
Regarding another SO question about std::back_insert_iterator
I’m trying to understand std::back_inserter
and std::back_insert_iterator
, and I read this Stack overflow question and the answers. As far as I understand, the answers say the operator *, ++, ++( int ) exist for a reason. But if I understand correctly, the code in that question does nothing regarding operators *,++,++(int). Also, cppreference.com says that the operators *, ++, ++( int ) are no-op.
Is IEnumerator extending IDisposable just an implementation detail forced by the C# language
The closest thing I came to find as a valid reason for IEnumerator<out T>
extending IDisposable
is from this answer that echoes work done by Jon Skeet – like this:
Whats the difference between it = v.erase(it) and v.erase(it)?
I was reading the cppreference documentation on vectors erase method. The documentation used the general syntax: it = v.erase(it);
to remove the element it
was pointing to and then increment it
to the next element in the vector.