home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,602 of 33,346   
   Seungbeom Kim to Carlo Milanesi   
   Re: "for_each + lambda" vs "ranged for"   
   02 Nov 11 11:27:47   
   
   From: musiphil@bawi.org   
      
   On 2011-11-01 12:33, Carlo Milanesi wrote:   
   > On 01/11/2011 11.58, topoden wrote:   
   >> Given we now have ranged for loops... Why do we still need   
   >> std::for_each + lambda? Doesn't ranged for loop do exactly the same   
   >> now?   
   >   
   > I would say: "Given we now have lambdas ... Why do we still need   
   > ranged-for loops?"   
      
   For one thing, for loops can have jump statements (such as "break", "goto",   
   or "return") leading out of them, for which lambdas have no equivalent.   
      
   --   
   Seungbeom Kim   
      
      
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca