3

I seen quora question https://www.quora.com/What-are-the-best-features-introduced-in-C++17 about C++17 best features, where I read printf("%d %d", i++, i++) no longer undefined behavior in C++17.

Last to second paragraph of answer written by Sergey Zubkov:

Oh, and it’s no longer undefined behavior to do printf("%d %d", i++, i++), although it’s still undefined behavior to do i++ + i++.

So, I have a question in my mind, is it really defined behaviour in C++17?

Jayesh
  • 4,303
  • 4
  • 25
  • 56
  • 2
    See http://stackoverflow.com/questions/38501587/what-are-the-evaluation-order-guarantees-introduced-by-c17: looks like it's now *unspecified* rather than *undefined* – stijn Apr 17 '17 at 06:45
  • 1
    It's still a bad idea to write this code whether or not it is undefined! – M.M Apr 17 '17 at 08:21

0 Answers0