を見つける::次のような構造に見つける...エラー::私はSTDを使用して、エラーを取得しています演算子==
struct ComplianceOrderRecord {
explicit ComplianceOrderRecord(IOrder& order);
bool operator ==(const ComplianceOrderRecord& other) const;
double price;
};
inline bool ComplianceOrderRecord::operator ==(const ComplianceOrderRecord& other) const {
return price == other.price;
}
を次のように私はそれを使用する...
inline void Compliance::RemoveComplianceOrderRecord(const ComplianceOrderRecord& order) {
auto it = std::find(m_compliantOrderList.begin(),
m_compliantOrderList.end(), order);
if(it == m_compliantOrderList.end()) {
return;
}
m_compliantOrderList.erase(it);
}
エラーがある
...
error C2679: binary '==' : no operator found which takes a right-hand operand of type 'const ComplianceOrderRecord' (or there is no acceptable conversion)
このエラーを理解する上で任意のヘルプは非常に高く評価されるだろう。
これを 'const'に更新すると、私は同じ結果になります。 – andre
'm_compliantOrderList'の宣言を教えてください –