Hi,
My organization recently migrated from VC++ 6.0 to VC++ 7.1. We have
found that the temporary objects created in VC++ 6.0 were not destroyed
after the end of the expression or statement, thus temporary objects
are available with in the scope where they were created. However in
VC++7.1, temporary objects are being destroyed after the statement in
which they was created. Thou C++ standard says that the temporary
objects are destroyed at the end of the statement, I am not sure why
VC++ 6.0 and 7.1 exhibit different behaviours, I would like to know if
VC++7.1 includes this new feature or it is an undefined behaviour? Also
where can I find the features/differences for 6.0 and 7.1?

thanks a lot
jk

Re: temporary objects in VC++ 6.0 vs VC++ 7.1 by Carl

Carl
Fri Jun 23 19:33:06 CDT 2006

"JK" <JKwaits@gmail.com> wrote in message
news:1151101051.539922.273210@p79g2000cwp.googlegroups.com...
> Hi,
> My organization recently migrated from VC++ 6.0 to VC++ 7.1. We have
> found that the temporary objects created in VC++ 6.0 were not destroyed
> after the end of the expression or statement, thus temporary objects
> are available with in the scope where they were created. However in
> VC++7.1, temporary objects are being destroyed after the statement in
> which they was created. Thou C++ standard says that the temporary
> objects are destroyed at the end of the statement, I am not sure why
> VC++ 6.0 and 7.1 exhibit different behaviours, I would like to know if
> VC++7.1 includes this new feature or it is an undefined behaviour? Also
> where can I find the features/differences for 6.0 and 7.1?

VC7.1 improved C++ standards compliance in many areas, including this one.

You can find differences between VC6 and VC7.1 here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcedit/html/vcoriwhatsnewinvisualcnet2003.asp

-cd