Discussion: Multiple index maps
Afficher un message
Vieux 01/07/2008, 09h24   #1
fgh.vbn.rty@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Multiple index maps

I am frequently using maps like the following:
map<string, map<int, vector< pair<int, int> > > > m1;
map<int, map<string, map<int, int> > > m2;

This can be a little difficult to maintain if another coder doesn't
really know the what the indexes stand for, the ordering of the
indexes, etc.,

Is there a better way to define multiple index maps? Of course, I can
typedef the inner maps into something more readable but is that always
good?

Sometimes the index ordering matters and sometimes it doesn't. Does
that make a difference?

  Réponse avec citation
 
Page generated in 0,04799 seconds with 9 queries