M
Mike Copeland
I need to sort a map structure on an element that's not the storage
key. Here's the structure declaration:
struct CSTYPE
{ // City/State Record
string csKey; // City/State "Key"
string csString; // City & State data
} extern workCS;
typedef map<string, CSTYPE> CSINFO;
CSINFO cityStInfo;
map<string, CSTYPE>::iterator csIter;
The element I'm storing the map is csString, but once the map is
constructed I want to sort the structure by csKey. I was hoping that
there's a way to either reconstruct the map data or sort it so that I
could iterate through it in "csKey" order. Any thoughts? TIA
key. Here's the structure declaration:
struct CSTYPE
{ // City/State Record
string csKey; // City/State "Key"
string csString; // City & State data
} extern workCS;
typedef map<string, CSTYPE> CSINFO;
CSINFO cityStInfo;
map<string, CSTYPE>::iterator csIter;
The element I'm storing the map is csString, but once the map is
constructed I want to sort the structure by csKey. I was hoping that
there's a way to either reconstruct the map data or sort it so that I
could iterate through it in "csKey" order. Any thoughts? TIA