
28 Feb
2020
28 Feb
'20
3:01 p.m.
On 28/02/2020 19.48, Oleg Grenrus wrote:
std::vector<int> variantC; variantC.reserve(100); for (int i = 0; i < 100; i++) { primitive.push_back(f(i)); }
I'm not a fan of changing `fromListN` to be partial function, but if that change is carried on in `vector` there should be a variant which allows to `reserve` without worrying about partiality.
- Oleg
Interestingly, reserve actually is a size hint in the sense of "must be equal or greater than". (According to cppreference.com, anway.)