Ответ 1
Вы забыли #include <algorithm>
.
Скажем, что у меня есть класс A и класс B, которые выглядят так:
Class A
{
private:
int a;
public :
bool operator==(const A &) const;
//other methods(...)
}
Class B
{
private:
std::vector<A> v;
public:
std::vector<A> &get_v() {return v;};
const std::vector<A>& get_v() const;
}
Теперь, когда я это сделаю:
B b;
std::vector<A>::iterator it;
it=std::find (b.get_v().begin(), b.get_v().end(), an item of class A);
Ошибка, которую я получаю,
error: no matching function for call to 'find(std::vector<A>::iterator, std::vector<A>::iterator, A&)
Я что-то упустил? Благодаря
Вы забыли #include <algorithm>
.
Я думаю, что вы забыли заголовок include <algorithm>