Disable GC entirely
Jacob Carlborg
doob at me.com
Wed Apr 10 05:46:27 PDT 2013
On 2013-04-10 11:19, Dicebot wrote:
> The question is then "what is class?". Because the very reason to have
> class is to have guaranteed polymorphic behavior, so that working with
> object via its base will always make sense without any fears about what
> behavior can be overriden. But that is mostly needed in OOP hell with
> few practical cases like plugins.
>
> If essentially coupling data and methods is needed, that is what struct
> does. I am not arguing that everything should be virtual, I am arguing
> that you actually need classes. It is not C++ and, in my opinion,
> structs should be much more common entities than classes, especially in
> performance-hungry code.
I often want reference types, but not necessarily polymorphic types.
What I want:
* Heap GC allocated
* Be able to store references
What I don't want:
* Pointers (don't guarantee heap allocated)
* ref parameters (can't store the reference)
* Implement reference counting
--
/Jacob Carlborg
More information about the Digitalmars-d
mailing list