I may not be asking this question right... Basically, I have a wrapper around an stl map. I would like to use either a map or a hash_map based on whether the user wants the items sorted or not. To achieve this, I wanted to have a pointer to the 'parent' class of both, and then based on the flag, either create a new map or a new hash_map. Is there a way to do this? Or should I just use a hash_map and sort it whenever anyone asks for an iterator?
By the way, I've been experimenting with hash_map and it seems that it is still somehow sorted. (Though this could be simply that the most efficient way to store hash_map<string,string> is in fact to sort it). Is there a way I can test/prove that a hash_map is not sorted?