3 ms·
> The question becomes why all_of returns true for an empty list. Because it is, if you'll forgive my Haskell-ese, the only implementation that means that `all
by JadeNB 2y ago
> The question becomes why all_of returns true for an empty list.
Because it is, if you'll forgive my Haskell-ese, the only implementation that means that `all_of $ l1 ++ l2 == (all_of l1) && (all_of l2)` for all lists `l1` and `l2`, including empty ones.
- gpderetta 2y agoyes of course, I was trying (and failed?) to draw a connection from all_of to accumulate (i.e. fold).
- JadeNB 2y agoAh, my apologies. I don't know my way around C++, and, by reading your comment too quickly, misread it to be saying that `all_of` behaved badly, rather than that its behavior could be better understood by looking elsewhere.