C++結構體作為map的key的時候需要過載

喻大帥發表於2016-08-31

typedef struct DICOMRowsAndVolumn{
	CString strRows;
	CString strColumn;
	bool operator <(const DICOMRowsAndVolumn &other) const
	{
		if(this->strRows==other.strRows && this->strColumn==other.strColumn) return false;
		else return true;
	}
}RowsAndVolumn;

//定義map
map<RowsAndVolumn,int> m_RowsAndVolumn;


相關文章