And just a few lines below that: "for (auto item : { 1, 2, 3, 4, 5, 6, 7, 8, 9 })". Why?? It's an almost comical abuse of C++11 for the sake of it.
This comment is very interesting. His syntax reminds me of Python syntax of:
for i in [1,2,3]:
Isn't that what the future C++ is trying to achieve? Simplified syntax? for (int i = 1; i != 10; ++i)I think your question was rhetorical, in any case the answer is yes. In fact the proposed C++ pythy syntax tries go even further http://pfultz2.github.io/Pythy/ . IIRC its Clang only. Its author hangs out on HN sometimes and would be able to provide more information
for i in range(1,4): for (int i = 1; i <= 9; ++i)
is both more concise and requires less thinking to know what's going on. for (auto item : {})
and then filled in the first sequence of numbers that popped into his head.It could be, but we don't know that. And that's exactly my point. The syntax he uses forces us to think and even speculate about that. So for the particular sequence he chose for his example, it would be less ambiguous to generate the range algorithmically.
If you should be so inclined later.