vector copying speed comparison
Which sequence is faster to copy one vector to another:
using for ..., or using iterators ? 1. copy (v_src.begin(), v_src.end(), back_inserter(v_dest)); OR 2. v_dest.resize(v_src.size()); for(unsigned i=0;i<v_src.size();i++) v_dest[i] = v_src[i]; |
Hmmm ;(
why don't you time the operations? on second thoughts i'm not familar with the func copy() and i can't find it in stroustrup's book?? |
All times are GMT -5. The time now is 08:29 PM. |