A quick poll about order of evaluation…

Consider this program fragment:


std::vector v = { 0, 0 };
int i = 0;
v[i++] = i++;
std::cout << v[0] << v[1] << endl;

My question is not what it might print under today’s C++ rules. The third line runs afoul of two different categories of undefined and unspecified behavior.


Rather, my question is what you would like the result to be. Please let me know.





Take Our Poll
Filed under: Uncategorized
 •  0 comments  •  flag
Share on Twitter
Published on December 01, 2014 12:46
No comments have been added yet.


Herb Sutter's Blog

Herb Sutter
Herb Sutter isn't a Goodreads Author (yet), but they do have a blog, so here are some recent posts imported from their feed.
Follow Herb Sutter's blog with rss.