#include <algorithm>
#include <locale> // toupper, tolower
[]()->char {
const char r = (lastc == ' ' || lastc == 0) ? toupper(c) : tolower(c);
lastc = c;
return r;
}
#include <algorithm>
#include <iostream> // transform
#include <vector>
int main()
{
std::vector<int> vect = { 1, 2, 3 };
std::transform(vect.begin(), vect.end(), vect.begin(),
[](int value) { return value + 1; });
for(int value : vect)
std::cout << value << std::endl;
return 0;
}
https://www.cprogramming.com/c++11/c++11-lambda-closures.html