
11 Oct
2006
11 Oct
'06
9:09 p.m.
Peter Dimov wrote:
Thorsten Ottosen wrote:
I think the bug is that the compiler does not allow one to take the adress of a temporary object (an rvalue). Normal compilers usually give a warning about it, but compile it.
Such code is ill-formed. No compiler is required to accept it. There are often area's where the standard says it is not required or undefined yet a majority of vendors DO allow it as is the case here I believe. In effect it becomes a de-facto but unofficial standard. Remember we as programmers tend to be lazy, if it works on most compilers we tend to expect it to work on all of them.