Is it possible to make a macro to loop through any kind of maps?
Normally, it's
For an xml class I have, I've actually made some looping macros which replacesCode:map<int, string>::iterator it; for(it = somemap.begin(); it != somemap.end(); it++){ // do schtuff }
intoCode:int i; for(i = 0; i < xmlnode.size(); i++){ xmlnode& tec = xmlnode[i]; // do schtuff }
So yeah, can the same be done with maps without having to specify their types? that is, I don't want:Code:xmlloop(xmlnode) // do stuff with "tec" as a xmlnode& xmlloopend
Code:maploop(int, string, somemap) // do stuff with it, which is an iterator.. maploopend



LinkBack URL
About LinkBacks


