If my vector starts out with some information in it such as:
vector<int> ordered_set; ordered_set.resize(5); for (int counter=0; counter<5; counter++){ ordered_set[counter]=counter+1; } Then I later resize it as:
ordered_set.resize(10,0); will the 1 through 5 still be guaranteed as the first five elements through the pointer arithmetic ordered_set[0,1,2..4]? or does the standard enable the contents to permute if contiguous memory is not found for the resize and a reallocation is required? In other words will ordered_set[0,1,2..4] potentially encounter a 0?