// This example (part of a series) illustrates how to to use a functor. #include #include #include using namespace std; int main() { string name = "Beverly Hills Chihuahua"; transform(name.begin(), name.end(), name.begin(), [](char c){ return 'a'<=c && c<='z' ? c-'a'+'A' : c; } ); cout << name << '\n'; }