June 2017
Intermediate to advanced
532 pages
12h 59m
English
We will implement very simple string filter predicates, and then we will combine them with a little helper function that does the combination for us in a generic way.
#include <iostream> #include <functional> #include <string> #include <iterator> #include <algorithm>
static bool begins_with_a (const std::string &s) { return s.find("a") == 0; } static bool ends_with_b (const std::string &s) { return s.rfind("b") == s.length() - 1; }
Read now
Unlock full access