- [Instructor] In functional programming,…partial application is a technique which creates…a new function with a smaller number of…arguments from an old one.…The number of arguments a function accepts…is called its arity.…Std::bind comes from the stl's functional header…and allows us to partially apply functions.…We can reorder the function's argument and…bind values to arbitrary arguments.…Let's take a look at std::bind with some code.…Now in this file, we've already included our…iostream's cmath and vector.…
We're using the namespace std and…we have a vector of int of ages.…And these ages represent the ages of our customers.…And we have a very simple problem.…We just want to know how many of our customers…are over 21.…Now typical programing what we would do is iterate…over this range.…Every time we see an age that's greater than or equal to 21…we increase this counter, which we initially set at zero.…And in the end, we print out the number that are over 21.…This code works.…It does what we asked it to do.…
The problem with it is it's not thinking functionally.…
- Unit testing and functional programming
- Function and Lambda functions
- C++ templates
- Working with the Standard Template Library and Boost.Hana
- Functional reactive programming
Skill Level Intermediate
2. Functional Programming in Modern C++
3. Template Metaprogramming
4. Functional Reactive Programming
RxCpp library5m 21s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.