c++ - What will happen if I keep incrementing an iterator? -


I have a simple question: What if I continue to extend the interferral Iterator () the last one) + STL container? E.g.

  set & lt; Int & gt; intSet; IntSet.insert (0); IntSet.insert (1); IntSet.insert (2); Set & lt; Int & gt; :: Iterator Setter = intSet.begin (); For (Int i = 0; I & lt; 10; i ++) Set Ether ++;   

So, will be set intSet.end () always? Or is it an undefined behavior (can I give incompatible junk)?

The only work to grow is nothing , at least the GNU compilers .

If you try dereference, it invites undefined behavior.

For more discussion, see.

Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -