Re: Bug in C++ /CLI 2005

Tech-Archive recommends: Fix windows errors by optimizing your registry



Mark Salsbery [MVP] wrote:
"Howard Swope" <howard_swopeAThms3DOTcom> wrote in message
news:Oyv$tJgJJHA.1308@xxxxxxxxxxxxxxxxxxxxxxx

Declaring variables with stack semantics is one of the Advertised
features in C++ CLI

Not member variables.

It makes no sense to have member variables with stack semantics -
there's no "stack" involved unless you have an actual object.

I definitely do NOT agree with this. Stack semantics give you all the
correct calls to Dispose in all the corner cases, like exceptions thrown in
constructor initializer lists, automatically. Stack semantics is perhaps
not the best description -- scoped variable lifetime (vs dynamic lifetime)
might be better.


.



Relevant Pages

  • Re: Bug in C++ /CLI 2005
    ... It makes no sense to have member variables with stack semantics - ... exceptions thrown in constructor initializer lists, ... Whoa, is someone impersonating the real Mark, the C++ MVP? ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Bug in C++ /CLI 2005
    ... It makes no sense to have member variables with stack semantics - there's no "stack" involved unless you have an actual object. ... And, as mentioned by others, you can't expect a member marked to be handled at ALL by the deserialize code in the framework. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Bug in C++ /CLI 2005
    ... It makes no sense to have member variables with stack semantics - ... Stack semantics give you all the correct calls to Dispose in all the corner cases, like exceptions thrown in constructor initializer lists, automatically. ... Stack semantics is perhaps not the best description -- scoped variable lifetime might be better. ...
    (microsoft.public.dotnet.languages.vc)