Remove!!!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	vector<int> aList(10);

	for (int index = 0; index < 10; index++)
		aList[index] = index;

	aList.erase(4);

	return 0;
}
Gives me an error message at line 13 of "No constructor could take the source type, or constructor overload resolution was ambiguous". Why is this?
Last edited on
The erase() method takes an iterator. You are giving it an integer.

aList.erase( aList.begin() +4 );

Enjoy!
Thanks!
Topic archived. No new replies allowed.