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

  • Playable
    1. 
    Course Overview
    2m 2s
    UP NEXT
  • Playable
    2. 
    Lambda Expressions
    5m 24s
  • Locked
    3. 
    Creating Lambdas
    6m 38s
  • Locked
    4. 
    Passing Lambdas into Functions
    6m 30s
  • Locked
    5. 
    Using Lambdas with STL Algorithms
    9m 29s
  • Locked
    6. 
    Lambda Closures
    5m 21s
  • Locked
    7. 
    Capturing Variables within Lambdas
    6m 39s
  • Locked
    8. 
    Capturing Variables by Reference
    9m 58s
  • Locked
    9. 
    Course Summary
    3m 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.