Do you mean something like this?
#include <iostream>
#include <tuple>
#include <vector>
#include <string>
using namespace std;
int main()
{
typedef tuple <int, string, int, int> pc_data;
vector <pc_data> pc_vec;
// Add some test data
pc_vec.push_back(make_tuple(0, "never gonna ", 0, 0));
pc_vec.push_back(make_tuple(1, "give you ", 1, 0));
pc_vec.push_back(make_tuple(2, "up, never ", 2, 0));
pc_vec.push_back(make_tuple(3, "stop. HAMMER TIME.", 3, 0));
pc_vec.push_back(make_tuple(4, "gonna let you ", 4, 0));
pc_vec.push_back(make_tuple(5, "down.\n", 5, 0));
//Assume that pc_vec is filled with elements somewhere here...
//This code is not working.
//Exception : vector subject out of range because of the size dynamically changing i suppose
for (int i=0; i < pc_vec.size(); i++)
{
// Test: we're going to delete the tuple of which the 3rd element (index 2) = 3.
if(get<2>(pc_vec[i]) == 3)
{
pc_vec.erase(pc_vec.begin() + i);
i--;
}
}
// Result:
for (int i = 0; i < pc_vec.size(); i++)
{
cout << get<1>(pc_vec[i]);
}
return 0;
}