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,605 of 33,346   
   Carlo Milanesi to topoden   
   Re: "for_each + lambda" vs "ranged for"   
   03 Nov 11 11:13:14   
   
   ba831311   
   From: carlo.nospam.milanesi@libero.it   
      
   On 02/11/2011 19:19, topoden wrote:   
   > On Nov 1, 3:33 pm, Carlo Milanesi   
   > wrote:   
   >>   
   >> Lambda is much more powerful than ranged-for.   
   >   
   > The question is actually not why we need lambdas, but why do we need   
   > std::for_each, given that we now have ranged for loop. I do see the   
   > need for lambdas, but its a bit unclear to me whats so good in having   
   > std::for_each in addition to ranged for loops...   
      
   std::for_each was in the standard since 1998, and in STL even before.   
   Would you deprecate it, forcing every people who used it to convert   
   their code?   
   In addition, as I said before, you can use for_each on a subrange, and   
   you cannot use a ranged-for on a subrange.   
      
   --   
      
   Carlo Milanesi   
   http://carlomilanesi.wordpress.com/   
      
      
         [ 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