3 ms·
> But it doesn't give one when the cast is in a loop condition. That is weird. I believe that the justification for that is that you'll often want to do e.g.
by mining 10y ago
> But it doesn't give one when the cast is in a loop condition. That is weird.
I believe that the justification for that is that you'll often want to do e.g.
while (node) {
node.val += 3;
node = node->next;
}
Implicit conversion of a type into a bool is pretty useful here, or for e.g.
while (std::cin >> x >> y) { ... }