Sun, 19 Jun 2011 12:34:54 +0200 passing by reference... my darkest enemy
koda [Sun, 19 Jun 2011 12:34:54 +0200] rev 5257
passing by reference... my darkest enemy actual reason below: In your case (without reference) the compiler generates a temporary object (int) for the first argument of your MyApplication constructor. You pass this temporary int to QApplication’s constructor (with int reference), which saves the address of this reference. Once your MyApplication constructor is done the temporary int is destroyed but QApplication still has its address.
(0) -3000 -1000 -300 -100 -30 -10 -1 +1 +10 +30 +100 +300 +1000 +3000 +10000 tip