------- Additional Comments From d_picco at hotmail dot com 2005-02-23 20:46 ------- Here is a better clarification:
Case 1 ====== int a = 0; int b = a++ + a++; printf("b = %d\n", b); // output is 0 Case 2 ====== class A { int a_; public: A() : a_(0) {} int operator++() { return a_++; } }; A a; int b = a++ + a++; printf("b = %d\n", b); // output is 1 This is a simple case that shows how the behaviour of the operator++ should be united. I'm not sure what you mean by the system(...) call... I understand that the code is undefined (meaning its up to the compiler vendor to implement as they see fit). I think the most fitting way is to have the above two cases unified in behaviour... isn't one of the reasons that operators were added to C++ was to allow user-defined types to mimic the functionality and usability of the native C types? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11751