Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • there seem to be performance problems with lambda's sometimes, and the indentation can get out of hand fast. But I thought of this too. Commented Jun 17, 2011 at 18:01
  • 2
    @rubenvb: If there's a performance problem with lambdas, then either the author sucked and copied way more than he meant to, or it's a compiler bug. Lambdas are extremely lightweight. Commented Jun 17, 2011 at 18:03
  • @DeadMG: yeah, true, and I shouldn't care about those bad implementations, but readability is a bigger concern here, also the fact that I may have return statements in the loops makes a lambda unusable for my case. Commented Jun 17, 2011 at 18:06
  • It's a little jarring to see, but BOOST_FOREACH can be more readable than std::foreach. Commented Jun 17, 2011 at 18:33
  • @Ben: Well, not having had the time to play with C++0x, I completely forgot about the new for loop syntax. @rubenvb: That's probably the most readable you can get. I've added it to my answer. Commented Jun 18, 2011 at 8:09