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 32,509 of 33,346   
   John G Harris to TheGunslinger   
   Re: lambda capture using references in s   
   02 Aug 12 13:12:40   
   
   From: news0@nospam.demon.co.uk   
      
   On Wed, 1 Aug 2012 at 21:27:43, in comp.lang.c++.moderated,   
   TheGunslinger wrote:   
   > On Wed, 25 Jul 2012 10:03:26 -0700 (PDT), "gast128@hotmail.com"   
   >  wrote:   
      
       
   > Here is a code snippet from Sams Learn C++ in One Hour a Day, 7th   
   > Edition, which covers Lambda functions (and the C++11 standard   
   > updates) and expressions, page 161, Listing 7.11:   
   >   
   > void DisplayNums(vector& DynArray)   
   >      {   
   >      for_each (DynArray.begin(), DynArray.end(),  \   
      
   Is the backslash at the end of the line really necessary? If so, what   
   happens if it's inadvertently followed by some spaces?   
      
      
   >     [] (int Element) {cout << Element << " ";} ); // Lambda   
   >   
   >      cout << endl;   
   >      }   
       
      
    John   
   --   
   John Harris   
      
      
         [ 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