I have the following code:
wxString getColorName(const wxColour& color)
{
typedef ColorComboBox::ColorMap::right_const_iterator ConstColorIterator;
ColorComboBox::ColorMap colorMap = ColorComboBox::getDefaultChoices();
ConstColorIterator it = colorMap.right.find(color);
return it != colorMap.right.end() ? it->second :
ColorComboBox::CUSTOM_COLOR;
}
where ColorMap is defined
typedef boost::bimaps::bimap \
<wxString, boost::bimaps::vector_of<wxColour> > \
ColorMap;
and I keep getting a long template error that basically says the find function does not exist. However
ColorMap::left_const_iterator it = choices_.left.find(GetValue());
compiles fine.
I have a hunch the find function is only defined in certain collection types of bimap. I cannot use a set_of wxColours because wxColour is not comparable. (What would that even mean?) I also tried changing the collection type to list_of, but that didn't work either. My whole point in using bimap was so that I could find values going either way. Am I using the wrong container? Is there another collection type I can use for wxColour that will allow me to use the find function?
EDIT: I ended up creating my own container class.