11 Jun
2014
11 Jun
'14
10:03 a.m.
* Henry Baker <hbaker1@pipeline.com> [Jun 11. 2014 15:53]:
[...]
Part (most) of the problem with array bounds checking was the idiotic separation of the loop index from the array itself.
for i=0 to n-1 do something with array[i]
Using C++11's mechanism ("for_each" in about every other language): Let X be a container (like an array or std::vector) for (auto t : X) do_something_with(t); The re-spawned keyword "auto" means "whatever type, take the correct one". I dare say this is as clean as it gets. Best, jj
[...]