Wording for Range-Based For Loop (Option #5)

Document number: N3271=11-0041
Author: Doug Gregor
Date: 2011-03-23
Reply-To: doug.gregor@gmail.com
Revises: N3257=11-0027

Proposed Wording

This paper provides proposed wording for "option #5" in N3257 by Jonathan Wakely and Bjarne Stroustrup, which specifies that the range-based for loop should look for member functions begin() and end() first, and fall back to the current ADL-based behavior only when the type of the range does not contain either "begin" or "end".

Proposed Wording

Modify 6.5.4 [stmt.ranged]p1 by inserting the following new bullet after the first: