How can I populate a vector of map along with a rowID , or an iterator for each row of a valuepair Set
Like for example
typedef std::map<string, string> mapDB;
mapDB mapDB_colVal;
typedef mapDB::iterator mapDB_iter ;
vector<pair<int,mapDB> > mapDB_vec;
//populate mapDB_colVal 1st row
mapDB_colVal["X"]="APPLE";
mapDB_colVal["Y"]="RED";
How can I assign/populate 1st row mapDB_vec with mapDB_colVal
//populate mapDB_colVal 2nd row
mapDB_colVal["X"]="PEAR";
mapDB_colval["Y"]="RED";
Any ideas would be most appreciated.
Thanks
Leo
I’m not sure what row IDs you want. If they’re just sequential numbers, then they would seem redundant, since vectors allow you to identify elements by their position.