O'Reilly logo

C++ All-in-One For Dummies, 3rd Edition by John Paul Mueller, Jeff Cogswell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7

Working with Lambda Expressions

In This Chapter

arrow Considering the problem that lambda expressions solve

arrow Writing your first lambda expression

arrow Using lambda expressions in real-world programming

The previous chapters in this book focus on the Unified Modeling Language (UML) and how you use it to better model applications. Chapter 6 moves on to design patterns, which actually help you implement a model. This chapter takes the process one step further by looking at lambda expressions — an elegant method of turning a model into a math expression. Let’s say that you need to calculate the number of widgets produced in an hour before you can print out the value. Adding the equation directly to the existing code might look bulky, but adding it as a separate function makes the code hard to read. Lambda expressions provide a middle ground where you can define the calculation in an easy-to-read manner without creating a separate function.

technicalstuff.eps Unlike many of the odd terms you’ve encountered so far in the book, we programmers have nothing to do with the term lambda expression — you can blame ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required