Help with CMap
-
I'm currently using a CMap because i need to associate a key with a specific value. But i also need to retreive the keys in a specific order. Is it possible to sort the keys in a map? Is there any other way to get the map functionality and be able to sort the keys?
-
I'm currently using a CMap because i need to associate a key with a specific value. But i also need to retreive the keys in a specific order. Is it possible to sort the keys in a map? Is there any other way to get the map functionality and be able to sort the keys?
Stefan Dahlin wrote: I'm currently using a CMap because i need to associate a key with a specific value. But i also need to retreive the keys in a specific order. Is it possible to sort the keys in a map? From memory CMap uses a hash table, in which case the answer is no. Stefan Dahlin wrote: Is there any other way to get the map functionality and be able to sort the keys? Yes move to STL. Look at Map and Multimap. Also this CP article may be of interest: http://www.codeproject.com/vcpp/stl/bimap.asp[^] Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program