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 course
    recognize lambdas and recall their syntax
    create and invoke lambdas
    pass lambdas into functions
    use lambdas with Standard Template Library (STL) algorithms
  • define and work with lambda closures
    capture variables and use default capture by copy
    capture variables by reference and from member methods
    summarize the key concepts covered in this course

IN THIS COURSE

EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE

Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.

Digital badges are yours to keep, forever.

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE