I am attempting to access the last member of the a vector which is the second part of the pair<string, vector<int>>. The following code snippet shows what I am attempting:
typedef std::multimap<std::string, p_sym_data> table_type;
typedef std::multimap<int, mark_type> table_type_i;
int calc_short(int nt, string nt_s, table_type *gsd, table_type *once, table_type_i *mark)
{
int pn=gsd->find(nt_s)->second[1];
table_type::iterator on;
table_type_i::iterator mk;
mk=mark->find(pn);
mk->second.push_back(true);
on=once->find(nt_s);
int a=on->second.pop_back();
return pn;
}
The following compile-time error is provided (gcc 4.1.2 20070626):
utilities.cpp: In function ‘int calc_short(int, std::string, table_type*, table_type*, table_type_i*)’:
utilities.cpp:59: error: void value not ignored as it ought to be
make: *** [utilities.o] Error 1
The error refers to the line just before the return statement. I believe that I should be able to do this based on some other examples I've googled. Any ideas as to why I cannot access the vector member in this way?