I would be careful with stating 'ordered by their identifier'. It's an implementation detail which might change, there is no need for this guarantee now and in fact I don't think they are mapped since you're iterating over a hash_set?