why can't int type be the iterator in STL vector? -
after chapter vector is the first question on question "c ++ STL" I have no answer Can give And while surfing the Internet, I do not get the answer.
A clear answer to a question (as has been asked) is that an Iterator like an indicator Need to work, so for some arbitrary iterator, * iterator is a valid code (working as a * is an unary operator).
For a int , this will not happen - something like i type int , you * i (except in a reference where * will be interpreted as a binary operator, such as multiplying j * i ).
Comments
Post a Comment