My understanding of what unordered_map
means is that is stores unit value per key without ordering them. But is it expected that insertion order is not preserved?
When I compile and run:
std::unordered_map<std::string,int> temp;
temp["Start"] = 0;
temp["Read"] = 0;
for ( auto iter : temp )
{
std::cout << iter.first.c_str();
}
With VS2015, it outputs
Start
Read
With GCC 4.9 for Android, it outputs:
Read
Start
Is it a bug, or expected?