Quote Originally Posted by laserlight View Post
std::inserter is an iterator adapter, not an algorithm, so on its own it cannot replace the loop.
I didn't mean that the whole loop should be replaced with std::inserter, but the piece of code that I quoted could be. I didn't want to look for a way to replace the whole loop because it would probably get too messy and didn't have time to figure it out.