Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Towards a more powerful and simpler C++ with Herb Sutter. Parent comment
why should it ? Adding features is enough for simplifying stuff.
eg take the following code:
for(auto& val : {1,3,12,17,20}) { val++; }
How would it look in cpp03 ? Two possibilities:
std::vector<int> v; v.push_back(1); v.push_back(3); ... v.push_back(20); for(std::vector<int>::iterator it = v.begin(); it != v.end(); ++it) { (*it)++; }
int v[] = {1,3,12,17,20}; for(int i = 0; i < (int)(sizeof(v)/sizeof(int)); i++) { v[i]++; }
There are no comments on this comment yet.
why should it ? Adding features is enough for simplifying stuff.
eg take the following code:
it leverages three new features: auto, range-based for, and braced initialization.How would it look in cpp03 ? Two possibilities:
Or