#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
	vector<int> test;
	test.push_back(1);
	test.push_back(2);
	test.push_back(3);
	
	for (vector<int>::iterator it = test.begin(); it != test.end(); )
	{
		cout << "Num [" << (*it) << "]" << endl;
		
		if ((*it) == 2)
			it = test.erase(it);
		else
			it++;
	}
	return 0;
}