OSNews article about C++09 degenerates into C++ vs. D discussion
Don Clugston
dac at nospam.com.au
Mon Nov 20 05:10:59 PST 2006
Walter Bright wrote:
> Boris Kolar wrote:
>> I don't understand why a good RIAA is not already a part of D. C++ has
>> it, so
>> it obviously can be done. The new 'scoped' keyword is insufficient for
>> me,
>> because I'd like to make all my classes scoped. I can usually develop
>> 99% of my C++ code without a single 'new' or 'malloc'. Most of my classes
>> are small (average ~2 fields and ~4 methods) and only used locally, so
>> I'm
>> really angry when I think about negative performance impact they will
>> have
>> in D simply because a decent RIAA is missing.
>
> Have you considered using structs instead of classes? They are allocated
> on the stack.
Can you do RAII with them?
I thought that a struct cannot have a destructor, but reading the spec
again I notice there's an entry for StructAllocator and
StructDeallocator, but no indication of how to use it.
More information about the Digitalmars-d
mailing list