May 2017
Intermediate to advanced
590 pages
17h 18m
English
The expression for the range-based for loops shown earlier in the How to do it... section is basically syntactic sugar as the compiler transforms it into something else. Before C++17, the code generated by the compiler used to be the following:
{ auto && __range = range_expression; for (auto __begin = begin_expr, __end = end_expr; __begin != __end; ++__begin) { range_declaration = *__begin; loop_statement } }
What begin_expr and end_expr are in this code depends on the type of the range:
Read now
Unlock full access