I've got typedef'd two maps
typedef std::map<std::string, std::map<std::string, migrationObj> > table;
typedef std::map<std::string, migrationObj> obj;
int main (int argc, char ** argv) {
table t;
t["test"].insert(obj::value_type("testID", 1));
return 0;
}
how would I be able to add a custom method to type table
(lets call it createItem), so that I can do
t["test"].createItem("testID", 1);
I know this looks a bit overhead to do this, but I've simplified the problem. The reason for me doing this is that I still need to do something in the createItem
to keep track of the insertion order of the map while maintaining the key lookup feature of a map.