3 ms·
That's cool, but I'd rather not bitwise-or my functional operators together. Something like this would be better: vector<int> squareVecFiltered(const vecto
by humanrebar 13y ago
That's cool, but I'd rather not bitwise-or my functional operators together. Something like this would be better:
vector<int> squareVecFiltered(const vector<int>& v) {
return from(v
filter([](int i){ return i % 2 == 0; }),
mapped([](int i){ return i * i; }),
as<vector>());
}
- stormbrew 13y agoThat is actually really nice.