First-class Functions in C++: Using Lambdas & Closures
C++ 17
| Expert
- 9 Videos | 55m 17s
- Includes Assessment
- Earns a Badge
In C++, a lambda expression is an ad-hoc, locally scoped function object that offers a function definition syntax. Lambdas can be stored in variables and invoked like function objects or function pointers, but lambdas go further by supporting context capture. In this course, learn how to define and invoke lambda functions and pass and return input arguments to and from lambdas using the Standard Template Library (STL) algorithms. Next, explore how context capture works in lambdas and implement closures. Finally, work with context capture to specify captured variables and whether the capture is by copy or by reference. Upon completion, you'll be able to define and invoke a lambda function, perform context capture by value and by reference, and define closures inside class methods.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this courserecognize lambdas and recall their syntaxcreate and invoke lambdaspass lambdas into functionsuse lambdas with Standard Template Library (STL) algorithms
-
define and work with lambda closurescapture variables and use default capture by copycapture variables by reference and from member methodssummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview2m 2sUP NEXT
-
2.Lambda Expressions5m 24s
-
3.Creating Lambdas6m 38s
-
4.Passing Lambdas into Functions6m 30s
-
5.Using Lambdas with STL Algorithms9m 29s
-
6.Lambda Closures5m 21s
-
7.Capturing Variables within Lambdas6m 39s
-
8.Capturing Variables by Reference9m 58s
-
9.Course Summary3m 16s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform
Digital badges are yours to keep, forever.