When using a list of initializers, for example:
for (int i : {3, 1, 6, 4})
{
std::cout << "i=" << i << std::endl;
}
The output is in the same order, 3, 1, 6, and finally 4. So, I know that the compiler should use something similar to std::vector<int>
, rather than std::set<int>
.
Is it guaranteed? Where can I find documents that explain how the compiler should interpret {3, 1, 6, 4}
.
source
share