Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  What Is an Iterator in C++, Part 2
Subject:   Post Increment
Date:   2006-09-14 06:05:43
From:   TopProf
In the complete text of your final solution, the post increment operator, quite correctly implemented in terms of the pre-increment operator, returns a reference. Unfortuneately this is a reference to a temporary variable, and results in undefined behaviour. The post increment operator should return a value, not a reference.