|
|
Subscribe / Log in / New account

lambda functions

lambda functions

Posted Dec 8, 2005 11:22 UTC (Thu) by mvogt (guest, #34379)
In reply to: lambda functions by pkolloch
Parent article: The Boost C++ Libraries

There is a special function; you can use

for_each(a.begin(), a.end(), std::cout << constant("blups:") << _1 << constant(' '));

to defer evaluation of the insertion operators until the lambda function is invoked. (You don't need the second 'constant' really; it will be deduced.)

There is also a 'var' function for deferring modifiable variables.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds