You can:
1) If your key is a structure you have created you can create the comparison function like this:
bool operator<(const YourType& k0, const YourType& k1)
{
//do stuff...
//return true if k0 is LESS than k1, if k0 is equal or more than k1 return false
}
bool operator<(const YourType& k0, const YourType& k1)
{
//do stuff...
//return true if k0 is LESS than k1, if k0 is equal or more than k1 return false
}
To copy to clipboard, switch view to plain text mode
2) Pass a compare function when you create the map. Read this it will explained it very well.
Bookmarks