私はshared_ptrのベクトルを持っています。find_ifとboost :: bindをshared_pointersのセットで使用する
私の質問は、代わりのものを除いて、thisに非常によく似ている「& MyClassの:: ReferenceFnは、」私は「&要素::のFn」を呼び出すしたいと思います。
は、ここでは、コードの類似した作品です。
no matching function for call to ‘bind(<unresolved overloaded function type>, const boost::reference_wrapper<B>, boost::arg<1>&)’
注:ここ
typedef boost::shared_ptr<Vertex> vertex_ptr;
std::set<vertex_ptr> vertices;
void B::convert()
{
...
if(std::find_if(boost::make_indirect_iterator(vertices.begin()),
boost::make_indirect_iterator(vertices.end()), boost::bind(&Vertex::id, boost::ref(*this), _1) == (*it)->id()) == vertices.end())
}
エラーです私はC++ 03を使用することに限定されています。
エラーはどうなりますか? –
@PiotrSkotnicki、エラーは、このクラスBのポインタとしてこのキーワードを取ることです。 –
boost :: bind(&Vertex :: id、_1)==(* it) - > id()) '(int型は' 'int型' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '' '')戻り値の型は 'id') –