Answer the question
In order to leave comments, you need to log in
Why does vector::end() return a const_iterator?
class SomeType{
std::vector<AnotherType> _items;
public:
void removeItem(AnotherType *pItem);
};
void SomeType::removeItem(AnotherType *pItem) {
auto found = std::find(_items.begin(), _items.end(), *pItem); // error
//....
}
C:\Qt\Tools\mingw492_32\i686-w64-mingw32\include\c++\bits\predefined_ops.h:191: ошибка: no match for 'operator==' (operand types are 'AnotherType' and 'const AnotherType')
{ return *__it == _M_value; }
^
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question