Sorry Holger,
I should have read your poster better.
When I first encountered this, I was puzzled too. String is probably one of
the most frequently used BCL class and to exclude it from stack semantics
seemed weird to me.
Here's a quote from Kapil Khosla [MSFT]
<quote>To answer your question. System::String is immutable. It means that
you
cannot modify the object once created. All methods exposed by the String
class actually create a new object containing the modification.
Thus, it doesnt make a lot of sense to have String object on the stack as we
cannot create a destructor for the String class. For all types where we
support the stack semantics, we require that the type must have a destructor
or the compiler should be able to create one.
Hope it helps,
Kapil </quote>
It doesn't really make a lot of sense to me. The fact that String is
immutable or that it does not have a destructor should not really have
affected the design decision to exclude it from stack semantics - unless I
am missing something. Perhaps, someone in the VC++ team would throw some
light on this.

Signature
Regards,
Nish [VC++ MVP]
>> System::String does not support stack semantics, so you cannot have a
>> String or a String%, you can have a String^ or a String^% though.
[quoted text clipped - 14 lines]
>
> -hg
Holger Grund - 15 Nov 2005 18:38 GMT
> When I first encountered this, I was puzzled too. String is probably one
> of the most frequently used BCL class and to exclude it from stack
[quoted text clipped - 6 lines]
> cannot modify the object once created. All methods exposed by the String
> class actually create a new object containing the modification.
Oc, there are readonly instance methods and properties that do not
modify the string.
> Thus, it doesnt make a lot of sense to have String object on the stack as
> we
> cannot create a destructor for the String class. For all types where we
What's wrong with not creating a dtor or one that does nothing?
> It doesn't really make a lot of sense to me. The fact that String is
> immutable or that it does not have a destructor should not really have
> affected the design decision to exclude it from stack semantics - unless I
> am missing something. Perhaps, someone in the VC++ team would throw some
> light on this.
Same here.
-hg