Introducing Functional Programming in C++
1h 15mIntermediate2018-12-11
Authors

Troy Miles
Award-winning Software Engineer, Speaker, and Author
Course details
Functional programming allows you to write more concise code that's easier to read, debug, and maintain. It revolves around powerful, mathematical functions that tell the computer what to do—not how to do it. The developer doesn't have to worry about order of execution, loops, or conditions. You simply define the desired outcome; the computer takes care of the rest. This course introduces the benefits and features of functional programming, and shows how to use different techniques and libraries in C++ to make code more functional. Instructor Troy Miles reviews built-in functions such as transform, copyif, accumulate, and bind and shows how to convert statements into more functional expressions using C++ Lambda functions. Plus, explore template metaprogramming with C++ templates and the STL and Boost.Hana libraries, and functional reactive programming with the RxCpp Reactive Extensions library for C++.
Learning objectives
Unit testing and functional programming
Binding
Function and Lambda functions
C++ templates
Working with the Standard Template Library and Boost.Hana
Functional reactive programming
Learning objectives
Unit testing and functional programming
Binding
Function and Lambda functions
C++ templates
Working with the Standard Template Library and Boost.Hana
Functional reactive programming
Skills covered
C++Introduction toProgramming FoundationsProgramming LanguagesOpen SourceSoftware Development
Concepts
0. Introduction
- 01 - Unleash the power functional programming in C++
- 02 - What you should know
1. Overview
- 03 - Benefits of functional programming
- 04 - Unit testing functional programming
2. Functional Programming in Modern C++
- 05 - Enabling C++ 17
- 06 - transform instead of map
- 07 - copy if instead of filter
- 08 - accumulate instead of reduce
- 09 - bind
- 10 - Functions
- 11 - Lambda functions - Curry
- 12 - Lambda functions - Closures
- 13 - Challenge - Factorial continuous add
- 14 - Solution - Factorial continuous add
3. Template Metaprogramming
- 15 - C++ templates
- 16 - Factorial
- 17 - The Standard Template Library
- 18 - Functional programming libraries
- 19 - Boost.Hana
- 20 - Challenge - Fibonacci generator
- 21 - Solution - Fibonacci generator
4. Functional Reactive Programming
- 22 - Intro to Reactive Extensions
- 23 - RxCpp library
- 24 - Challenge - Word frequency counter
- 25 - Solution - Word frequency counter
Conclusion
- 26 - Next steps