Click here to Skip to main content
15,888,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: what about x = x++; ? Pin
David Crow15-Sep-05 9:22
David Crow15-Sep-05 9:22 
GeneralRe: what about x = x++; ? Pin
bugDanny16-Sep-05 2:51
bugDanny16-Sep-05 2:51 
AnswerRe: what about x = x++; ? Pin
Joaquín M López Muñoz15-Sep-05 6:51
Joaquín M López Muñoz15-Sep-05 6:51 
GeneralRe: what about x = x++; ? Pin
bugDanny15-Sep-05 7:23
bugDanny15-Sep-05 7:23 
GeneralRe: what about x = x++; ? Pin
Joaquín M López Muñoz16-Sep-05 5:00
Joaquín M López Muñoz16-Sep-05 5:00 
GeneralRe: what about x = x++; ? Pin
bugDanny16-Sep-05 6:45
bugDanny16-Sep-05 6:45 
GeneralRe: what about x = x++; ? Pin
Joaquín M López Muñoz16-Sep-05 7:05
Joaquín M López Muñoz16-Sep-05 7:05 
GeneralRe: what about x = x++; ? Pin
bugDanny16-Sep-05 7:41
bugDanny16-Sep-05 7:41 
Joaquín M López Muñoz wrote:
There's no such a thing as int::operator=() or anything similar

I know this. I was trying to use it as an example of what is happening.


Joaquín M López Muñoz wrote:
please let me forward you to this answer[^] to the very same problem by Andrew Koenig

Thank you for this. I was wondering about a non-trivial situation where someone might write x=x++.


Joaquín M López Muñoz wrote:
Andrew is one of the original designers of the C++ language along with Bjarne Stroustrup, so I think you'll be willing to trust his opinion on this matter

I appreciate the information you provided. As I admitted in one of my other posts, the author I was quoting could have been just plain wrong, or perhaps he was writing the book just in conjuction with the compiler he was distributing the book.

So I guess the whole point of this thread may be: Don't sit and theorize about how the code should or shouldn't work, or what may or may not happen when you compile it. Compile the code, test it, and then you will know just how it works. But even better: simplify your code, remove ambiguity, and don't leave problems such as this up to the compiler to try to figure out.

Danny

-- modified at 13:41 Friday 16th September, 2005
AnswerRe: what about x = x++; ? Pin
Anonymous15-Sep-05 8:30
Anonymous15-Sep-05 8:30 
GeneralRe: what about x = x++; ? Pin
Anonymous15-Sep-05 8:38
Anonymous15-Sep-05 8:38 
GeneralRe: what about x = x++; ? Pin
bugDanny15-Sep-05 8:57
bugDanny15-Sep-05 8:57 
GeneralRe: what about x = x++; ? Pin
Chris Losinger15-Sep-05 8:59
professionalChris Losinger15-Sep-05 8:59 
GeneralRe: what about x = x++; ? Pin
bugDanny15-Sep-05 9:05
bugDanny15-Sep-05 9:05 
GeneralRe: what about x = x++; ? Pin
David Crow15-Sep-05 9:32
David Crow15-Sep-05 9:32 
GeneralRe: what about x = x++; ? Pin
pesho293215-Sep-05 21:02
pesho293215-Sep-05 21:02 
GeneralRe: what about x = x++; ? Pin
David Crow16-Sep-05 2:15
David Crow16-Sep-05 2:15 
GeneralRe: what about x = x++; ? Pin
bugDanny16-Sep-05 3:15
bugDanny16-Sep-05 3:15 
GeneralRe: what about x = x++; ? Pin
pesho293216-Sep-05 3:36
pesho293216-Sep-05 3:36 
GeneralRe: what about x = x++; ? Pin
bugDanny16-Sep-05 4:19
bugDanny16-Sep-05 4:19 
GeneralRe: what about x = x++; ? Pin
pesho293218-Sep-05 21:48
pesho293218-Sep-05 21:48 
GeneralRe: what about x = x++; ? Pin
bugDanny19-Sep-05 3:02
bugDanny19-Sep-05 3:02 
GeneralRe: what about x = x++; ? Pin
pesho293219-Sep-05 5:38
pesho293219-Sep-05 5:38 
GeneralRe: what about x = x++; ? Pin
bugDanny19-Sep-05 7:43
bugDanny19-Sep-05 7:43 
GeneralRe: what about x = x++; ? Pin
pesho293219-Sep-05 21:14
pesho293219-Sep-05 21:14 
GeneralRe: what about x = x++; ? Pin
bugDanny20-Sep-05 3:16
bugDanny20-Sep-05 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.