Are you sure this is correct? You hold a reference to a temporary object here. The fact that it works in this case doesn't mean this is a correct statement.Originally Posted by jacek
What if you store the reference to that object as a member of some class?
Will compiler optimisations not affect the correctness of the above statement?
Bookmarks