[C++-sig] Optimize vector_indexing_suite set_slice

Joel de Guzman joel at boost-consulting.com
Mon Aug 9 06:10:46 CEST 2004

Neal D. Becker wrote:

> vector_indexing_suite set_slice does: 1) erase 2) insert
> Shouldn't this be optimized to simply do copy?

You mean this:

     container.erase(container.begin()+from, container.begin()+to);
     container.insert(container.begin()+from, v);

Pardon me for being slow, but how? Could you spell it out for me?

Joel de Guzman

More information about the Cplusplus-sig mailing list