我们经常以这种方式从最后一个元素开始循环遍历数组:
static const char* pszStrings[] = { ... }
for (size_t i = _countof(pszStrings); i--;)
use(pszStrings[i]);
我的问题是,如果新的基于范围的for循环同样高效并且可以使用:
static const char* pszStrings[] = { ... }
for (auto string : pszStrings)
use(string);
此外...
由于我无法查看生成的代码,即使能够查看,我也不知道是否能够得出正确的结论,因此我希望您能提供不太科学的答案!