cygwin g++ strictness
Fri Oct 31 12:49:00 GMT 2008
----- Original Message -----
From: "Dave Korn"
Sent: 31 October 2008 12:22
Subject: RE: cygwin g++ strictness
> You are creating temporaries here. If AddTwoInts modifies either of the
> int references it has, that will only change the temporaries; x and y will
> /not/ be modified.
You'll be surprised if you try it Dave....
int AddTwoInts (int& a, int& b)
int x = a;
int y = b;
a = 6; // Note this line
return x + y;
AddTwoInts ((int&)m, n);
return 0; // 'm' equals 6 by the time you get to this line !!
I was surprised too - but it works (!?!)
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin