It depends: if you insert the same elements in the same order into two different unordered containers, then the order should be the same for both containers , even if the order itself is not specified .
The rationale is a bit confusing: all operations like hash(k) and redistributions are deterministic. However, there is no actual quote in the standard, but the ability to do find() in O(1) after insert() seems to exclude any randomized or other non-deterministic insert.
However, if you change the insertion order, all bets will be disabled, as internal redistributions will change the order of the elements:
23.2.5 Unordered associative containers [unord.req]
9 Elements of an unordered associative container are organized into buckets. Keys with the same hash code are displayed in the same bucket. The number of buckets automatically increases as items are added to the disordered associative container, so that the average number of items per bucket is stored below the border. Reprocessing is invalid; iterators change the order between elements , and changes that bucket elements appear but do not invalidate pointers or references to elements. For unordered_multiset and unordered_multimap, rehashing preserves the relative order of equivalent elements.
source share