Troy shows his solution to the word frequency counter problem. It is surprisingly small. He also contrasts his solution with one using traditional C++.
(intro music)…- [Instructor] How did you do with the challenge?…Hopefully, everything went well.…Let me share my solution to this challenge with you.…So, basically there are three steps.…We modify the filter operator,…we remove the count operator, and then we update the output.…And let's go ahead and start from scratch again,…and let me show you what I did.…So, here we are back in Visual Studio Code,…and what we're going to do, let's just redo…what we did previously.…
So, we're going to go ahead and say, auto values…equals rxcpp colon colon observable…and then we have iterate(ages).…Then, we have a dot to chain this together.…
Then, we're going to say filter…and we take a lambda again,…and then the lambda is going to get passed in age,…and that's going to be an integer.…And we're going to say return age,…greater than or equal to 13…and age…less than…or equal to 19,…and a semicolon.…
And then, we have another period here…to chain it together.…Then, we're going to do our subscribe.…Notice, we did not do a count at all.…
- 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
Learning Functional Programming with Swiftwith Shaun Wassell53m 12s 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.