2008-03-14

fivemack: (Default)
2008-03-14 11:37 am

Have I been needlessly verbose these many years?

Suppose I have an object of some naturally-occurring reasonably fiddly C++ STL type: say

map<float,vector<map<string,pair<int,clipper::Coord_orth> > > > W;

and I want to iterate over it.

Is there any way that I can say something like typeof(W)::iterator, rather than having to write for loops whose initialiser is already wider than the screen?

for (map<float,vector<map<string,pair<int,clipper::Coord_orth> > > >::iterator Z = W.begin(); Z != W.end(); Z++)