A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
You likely want x = A.erase(x). vector::erase returns an iterator to the element following the one that's erased.
The reason A.erase(x); --x; doesn't work is because erase(x) invalidates the iterator. The only thing you can do with x afterwards is assign a new value to it.