私は助けが必要です。セットを反復しようとすると、次のエラーが発生します。
エラー 1 エラー C2440: '初期化中': 'std::_Tree_const_iterator<_Mytree>' から 'compound_objectNS::Compound_object *' に変換できません c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory 208
次のコードを取得しました: ファイル "compound_object.cpp" から抽出:
typedef compound_objectNS::Compound_object OBJECT
bool OBJECT::operator== (const Compound_object &object) const
{
return this == &object;
}
bool OBJECT::operator< (const Compound_object &object) const
{
return this->m_numberOfObject < object.m_numberOfObject;
}
ここで要素をソートできるようにするには、演算子「==」と「<」をオーバーライドします
クライアントファイル:
for (objectImitatorNS::set<compound_objectNS::Compound_object*>::iterator it = Objects->begin();
it != Objects->end(); ++it)
{
this->m_imitatedObjects->insert(it);
}
私が考え出したように、行のときにエラーが発生します
this->m_imitatedObjects->insert(それ)
実行されました。
この問題を解決するには?