In c++ primer, pg 95 the author says that c++ programmers tend to use != in preference of < when writing loops.
for (vector<int>::size_type i = 0; i != 10; ++i) is preferred instead of
for (vector<int>::size_type i = 0; i < 10; ++i)
I read the same thing in accelerated c++. Can someone explain the rationale behind this
When using some kinds of STL iterators (those that aren’t random access), you must use
!=:However, I don’t see any reason to prefer
!=for well-ordered scalar types as in your example. I would usually prefer<for scalar types and!=for all iterator types.