Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Functional Programming with C++

You're reading from   Hands-On Functional Programming with C++ An effective guide to writing accelerated functional code using C++17 and C++20

Arrow left icon
Product type Paperback
Published in Jun 2019
Publisher Packt
ISBN-13 9781789807332
Length 358 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Alexandru Bolboaca Alexandru Bolboaca
Author Profile Icon Alexandru Bolboaca
Alexandru Bolboaca
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Section 1: Functional Building Blocks in C++ FREE CHAPTER
2. An Introduction to Functional Programming 3. Understanding Pure Functions 4. Deep Dive into Lambdas 5. The Idea of Functional Composition 6. Partial Application and Currying 7. Section 2: Design with Functions
8. Thinking in Functions - from Data in to Data out 9. Removing Duplication with Functional Operations 10. Improving Cohesion Using Classes 11. Test-Driven Development for Functional Programming 12. Section 3: Reaping the Benefits of Functional Programming
13. Performance Optimization 14. Property-Based Testing 15. Refactoring to and through Pure Functions 16. Immutability and Architecture - Event Sourcing 17. Section 4: The Present and Future of Functional Programming in C++
18. Lazy Evaluation Using the Ranges Library 19. STL Support and Proposals 20. Standard Language Support and Proposals 21. Assessments 22. Other Books You May Enjoy

Summary

Eric Niebler's ranges library is a rare feat in software engineering. It manages to simplify the use of existing STL high-order functions, while adding lazy evaluation, with a topping of data generation. Not only is it part of the C++ 20 standard, but it is also useful for older versions of C++.

Even if you don't use a functional style of structuring your code, and whether you prefer mutable or immutable code, the ranges library allows you to make it elegant and composable. Therefore, I advise you to play with it and try for yourself how it changes your code. It's definitely worth it, and it's an enjoyable exercise.

We're closing in on the end of this book. It's now time to have a look at STL and the language standard support functional programming, and what we can expect from C++ 20, and this will be the topic of the next chapter.

...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image