Classes in D and C++
Kyle Furlong
kylefurlong at gmail.com
Mon Mar 5 04:28:26 PST 2007
>
> Walter Bright wrote:
>> Uno wrote:
>>>> Its not possible it seems to do e.g this:
>>>>
>>>> X x(3);
>>>>
>>>> rather you have to do:
>>>>
>>>> X x = new X(3);
>>> Yep, I don't like that syntax too. Everywhere news.. And although D
>>> has many great features such small things prevent me to switch to D.
>>>
>> You can do:
>>
>> auto x = X(3);
>>
>> and x will be put on the stack.
>
> Surely you mean
>
> scope x = X(3);
>
> Or did scope get rolled back into the auto keyword again while I wasn't
> looking? >_<
>
http://www.digitalmars.com/d/memory.html#stackclass
More information about the Digitalmars-d
mailing list