3 ms·
It's probably easier to understand if you read about the "if statement with initializer" linked from the post: https://www.open-std.org/jtc1/sc22/wg21/docs/pape
by grg0 3mo ago
It's probably easier to understand if you read about the "if statement with initializer" linked from the post: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0305r0.html https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p03...
- dataflow 3mo agoNot really, I was well aware of if-with-init and I still found this quite confusing. That one actually shows what the variable is initialized to. This one doesn't.
- hdjrudni 3mo ago> That one actually shows what the variable is initialized to. This one doesn't. reply Which variable? `i` is clearly initialized to `0` and `it` doesn't have an initializer per se... it starts at the first value of the container. It almost seems like an abuse to put 2 unrelated things in the `for(...)` but that's what they did.
- grg0 2mo ago[dead]