Reputation: 12236
error: cannot convert 'std::vector<int>::iterator {aka __gnu_cxx::__normal_iterator<int*, std::vector<int> >}' to 'const char*' for argument '1' to 'int remove(const char*)
When I am doing
vec.erase(std::remove(vec.begin(), vec.end(), valToRemove), vec.end());
valToRemove is an int.
Upvotes: 2
Views: 2183
Reputation: 4435
You were most likely trying to call this function instead the correct one. Probably you don't have <algorithm>
included so the compiler can't see the overloaded version of the function.
Upvotes: 15