Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Coursera

C++ Lambda Expressions - From C++98 to C++23

Packt via Coursera

Overview

Coursera Spring Sale
40% Off Coursera Plus Annual!
Grab it
This course features Coursera Coach! A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. This comprehensive course takes you on an in-depth journey through C++ lambda expressions, starting from the basics and moving through advanced features introduced in C++11, C++14, C++17, C++20, and C++23. Whether you’re a beginner or experienced developer, you'll master callable entities and the ever-evolving power of lambdas in C++. You'll also learn about function pointers, function objects, and various lambda-specific optimizations across multiple C++ versions. As you progress, you will first delve into the essentials of function pointers and function objects, exploring real-world examples and key differences. The course then builds up with C++11 lambda expressions, teaching you how to use these to handle dynamic callbacks and closures. After that, you'll gain hands-on experience with C++14, C++17, C++20, and C++23 advancements, focusing on things like constexpr lambdas, generic lambdas, and more. Advanced topics such as recursive lambdas, static lambdas, and improved operator() handling round out the curriculum. This course is designed for C++ developers at any stage in their journey. Some prior programming knowledge will be helpful, particularly familiarity with C++ syntax and basic programming concepts. The course caters to developers seeking to enhance their understanding of C++ callable entities, providing an intermediate level of difficulty. By the end of the course, you will be able to confidently use lambda expressions in your C++ projects, leveraging the full potential of modern C++ to write efficient, concise, and maintainable code.

Syllabus

  • Introduction
    • In this module, we will introduce the course structure, roadmap, and objectives. You will gain an understanding of how mastering C++ callable entities like function pointers, function objects, and lambdas will enhance your coding proficiency. This section will set the foundation for exploring the power of C++ features from C++98 to C++23.
  • Function Pointers
    • In this module, we will cover the fundamentals of function pointers, from basic syntax to advanced examples. You’ll learn how to use function pointers for flexible, dynamic execution and understand callbacks and pointers to member functions in the context of C++ programming. This section will equip you with essential skills for implementing responsive, event-driven programs.
  • Function Objects
    • In this module, we will explore function objects (also known as functors), comparing them with function pointers. We will show you how to craft efficient, reusable callable entities and teach techniques to refine these objects for improved performance. By the end of this section, you'll be equipped to leverage the full potential of function objects.
  • Lambda Features in C++11
    • In this module, we will dive deep into the core features of C++11 lambdas. You’ll learn how to use capture lists, different capture methods (by reference, by value), and lambda conversions. With examples of Immediately Invoked Function Expressions (IIFE), you will be able to use lambdas effectively to create clean and compact code.
  • Lambda Features in C++14 and C++17
    • In this module, we will explore how C++14 and C++17 enhanced lambda expressions. You’ll learn about generic lambdas, generalized lambda captures, and constexpr lambdas for performing compile-time computations. These advanced features will take your lambda skills to the next level, making your code more flexible and efficient.
  • Lambda Features in C++20
    • In this module, we will focus on the advancements introduced in C++20, including implicit capture of this in lambdas, template type parameters, and constraints with concepts. These new features allow you to write more elegant and type-safe lambda expressions, improving both the performance and maintainability of your code.
  • Lambda Features in C++23
    • In this module, we will explore the cutting-edge lambda features introduced in C++23. You will learn how to implement static lambdas, apply recursive lambda patterns, and add attributes to lambdas for optimization. This section will help you harness the latest tools to write more powerful and efficient lambdas.

Taught by

Packt - Course Instructors

Reviews

Start your review of C++ Lambda Expressions - From C++98 to C++23

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.