User Tools

Site Tools


c_begin_end

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c_begin_end [2018/02/05 12:14]
rpjday created
c_begin_end [2018/02/05 12:15] (current)
rpjday [The rules (from TC++PL4)]
Line 9: Line 9:
   * the compiler first looks for members ''​begin''​ and ''​end''​ and tries to use those. If a ''​begin''​ or an ''​end''​ is found that cannot be used as a range (e.g., because a member ''​begin''​ is a variable rather than a function), the range-''​for''​ is an error.   * the compiler first looks for members ''​begin''​ and ''​end''​ and tries to use those. If a ''​begin''​ or an ''​end''​ is found that cannot be used as a range (e.g., because a member ''​begin''​ is a variable rather than a function), the range-''​for''​ is an error.
   * Otherwise, the compiler looks for a ''​begin/​end''​ member pair in the enclosing scope. If none is found or if what is found cannot be used (e.g., because the ''​begin''​ did not take an argument of the sequence’s type), the range-''​for''​ is an error.   * Otherwise, the compiler looks for a ''​begin/​end''​ member pair in the enclosing scope. If none is found or if what is found cannot be used (e.g., because the ''​begin''​ did not take an argument of the sequence’s type), the range-''​for''​ is an error.
 +
 +Add more regarding standard library header ''<​iterator>''​.
c_begin_end.txt · Last modified: 2018/02/05 12:15 by rpjday