You've just obtained lambda superpowers! Not only can you write simple lambdas in C++, but you also know the following:
- How to capture variables from the context
- How to specify the default capture type—by reference or by value
- How to write immutable lambdas even when capturing values
- How to use lambdas in classes
We've also touched on the design principle of low coupling and how lambdas can help with this. We'll keep mentioning this principle in the following chapters.
Would you believe me if I told you that lambdas are even more powerful than what we've seen so far? Well, we'll discover that we can grow from simple to complex lambdas through functional composition.