나는 다음과 같은 코드가 있습니다발견() 부스트 bimap 문제
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;
}
색상 맵
typedef boost::bimaps::bimap \
<wxString, boost::bimaps::vector_of<wxColour> > \
ColorMap;
정의되고, 나는 기본적으로 찾기 기능을하지 않습니다 말한다 긴 템플릿 오류가 계속 있다. 그러나
ColorMap::left_const_iterator it = choices_.left.find(GetValue());
괜찮습니다.
필자는 bimap의 특정 컬렉션 유형에서만 find 함수가 정의되어 있다는 점에 대해 잘 알고 있습니다. wxColour를 비교할 수 없기 때문에 set_of wxColours를 사용할 수 없습니다. (그게 무슨 뜻일까요?) 또한 컬렉션 유형을 list_of로 변경하려고했지만 그 중 하나도 작동하지 않았습니다. bimap을 사용함에있어서의 나의 요지는 어느쪽으로 든 값을 찾을 수있게하기 위해서였습니다. 잘못된 컨테이너를 사용하고 있습니까? find 함수를 사용할 수 있도록 wxColour에 사용할 수있는 다른 컬렉션 유형이 있습니까?
편집 : 나는 내 자신의 컨테이너 클래스를 만들었습니다.
감사합니다. 당신의 대답은 좋은 것이므로 다른 해결책을 찾았음에도 당신을지지했습니다. – Eva