Paulo Matos <[EMAIL PROTECTED]> wrote:
: Hi all,

: I've wanted to know if there was any performance difference between
: using:
: for(vector<int>::const_iterator it = v.begin(); it != v.end(); ++it)

: and

: for(unsigned int k = 0; k < v.size(); ++k)

Try

unsigned int size = v.size();
for (unsigned int k = 0; k < size; ++k)

in your version size() is evaluated size times

: Cheers,


-- 
        -lauther

[nosave]
----------------------------------------------------------------------------
Ulrich Lauther          ph: +49 89 636 48834 fx: ... 636 42284
Siemens CT SE 6         Internet: [EMAIL PROTECTED]
_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to