Reinitializing list's begin iterator after few elements were erased from the head
Fixing C4146 warning

Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Merge pull request #4823

1e73504 Fixing C4146 warning (ENikS)
Merge pull request #4969

cda45b5 Reinitializing list's begin iterator after few elements were erased from the head (ENikS)