Lambda Expressions in C++
- Posted: Jul 24, 2009 at 1:03 PM
- 55,032 Views
- 8 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
In this interview, programming writer Thomas Petchel demonstrates how to use Lambda Expressions in C++. You can also learn more in the topic: Lambda Expressions
in C++.
Kathleen McGrath
Visual Studio User Education
http://blogs.msdn.com/kathleen
Kathleen McGrath
Visual Studio User Education
http://blogs.msdn.com/kathleen
Comments Closed
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Functions can maintain state if you use static to declare the variables, e.g.,
{I don't recommend doing this, but it is technically possible, contrary to what was stated in the video.
Also, the second program Thomas wrote summed the primes in the range [3..20], not the first 20 prime numbers.
Will extension methods also be there?
Hi Joe,
Yes, you're correct that you can use static variables to maintain state between function calls. Perhaps it's better to say that lambda expressions enable you to share state between a function and its caller, because a static local variable is only accessible from the scope of the function in which it is defined.
You also caught me saying "the first 20 prime numbers". I realized later that I said this. Thanks for the correction.
do we need them?
C++ allows non-member functions. Problem solved.
I think lambda are great!!! I wish more people would learn how to use them when they first start learning how to program. I sometimes find when you are teaching the basics of computer programming to beginning programmers the old-style methods are usually the best,
By the way, prime numbers start with 2, not 3!
Where did the high quality video version go ?I can't see the text !
I cant see the code in the video, can you please send me the code.
Remove this comment
Remove this thread
close