The example for range-based for-loops on the about page transforms this piece of code:
#include <cstdio>
int main()
{
const char arr[]{2,4,6,8,10};
for(const char& c : arr)
{
printf("c=%c\n", c);
}
}
into this:
#include <cstdio>
int main()
{
const char arr[]{2,4,6,8,10};
{
auto&& __range1 = arr;
const char * __begin1 = __range1;
const char * __end1 = __range1 + 5l;
for( ; __begin1 != __end1; ++__begin1 )
{
const char & c = *__begin1;
printf("c=%c\n", static_cast<int>(c));
}
}
}
Leaving the auto&& __range1 = arr; is wrong as it was pointed out here.
The example for range-based for-loops on the about page transforms this piece of code:
into this:
Leaving the
auto&& __range1 = arr;is wrong as it was pointed out here.