On Fri, 2013-12-13 at 10:38 +0100, Richard Biener wrote: > Apart from the issues raised by Trevor I want to question if we want > to transition > to STL-like iterators (yeah, I know, the gsi_ ones are already > similar).
I think it's easier to read and -- more importantly -- understand "foreign" code if that code is using well established names and semantics for doing common trivial things. Iterating over containers is one such thing. Moreover, STL usage is allowed in GCC and adopting STL container semantics will make it easier to switch container implementations (e.g. try using std::vector instead of vec) and have a more consistent way of doing such common things. > An obvious > cleanup to the existing FOR_EACH machinery is to declare the iterator inside > the FOR_EACH, thus make it an implementation detail (like I did with the loop > iterator). I think variable declarations with hard coded names hidden in macros are not always straight forward to follow. If there was a common way of iterating over stuff, something like boost's FOR_EACH could be added instead, although I don't think it's worth the effort to re-implement it. Cheers, Oleg