1. Why is it horrible? I use it all the time and it saves me a lot of time and makes the code easier to read.
1. It creates two variables it and uu, but that's just something the user has to know. There's no indication that this is what it does.
2. It's poorly named. It's not immediately clear from the name it's a foreach helper macro.
3. It only works with [font=courier new,courier,monospace]std::list[/font]s
4. It's an unnecessary macro that pollutes the global namespace (and everything else). You better hope the identifiers [font=courier new,courier,monospace]loop[/font] and [font=courier new,courier,monospace]endLoop[/font] aren't reused anywhere.
5. It can't be used with [font=courier new,courier,monospace]const std::list[/font]s (which you would probably need, if you're following const-correctness)
6. SiCrane implemented it in two lines of code. Really, it's not saving you much work.
7. My computer's battery is dying, I'll let others add to this list
2. Seems you still pass both class and list to the macro, or did i misunderstand?
I think he just copie'd 'n' pasted the macro. You can delete the class parameter from the macro with SiCrane's implementation.
3. Thats a separate library right? No way to do it in standard c++?
It is a separate library, but if you're using C++11,
there is a way to do this in standard C++.