Problems erasing 2d vectors

I have a 2d vector that I am using to store a variable amount of coordinates. I originally wanted to do a 1d vector that contained a 2-element array, but I couldn't figure out the correct syntax for it so I decided to just go with a 2d vector.

Here's the declaration
vector<vector<int> > coords;

Here's the tidbit that adds coords to the vector
coords.push_back({anchorX,anchorY});

And here's the tidbit that tries to delete one of the coords out of the vector, where objectID is the index of the coords we want to delete.
coords.erase(coords.begin()+objectID-1);

For the strangest reason, this gives me something called "error 3". Error 3 is what I think is an ide specific error (codeblocks), so I dont imagine it is of much help. Is this a problem with my syntax or implementation?
The adding part is wrong.
This is a misuse of vectors, write a
1
2
3
4
5
struct COORD{
   int x, y;
   COORD(){}
   COORD(int x, int y) : x(x), y(y) {}
};

and then
1
2
vector<COORD> coords;
coord.push_back( COORD( 2, 3 ) );
Thank you!
Topic archived. No new replies allowed.