Are D classes always garbage collected?

Froglegs lugtug at gmail.com
Wed Dec 21 18:29:07 PST 2011


  From what I understand D classes are reference types, which 
would imply to me that they are either always garbage collected 
or rather less likely, reference counting.

Which is fine and all, but since structs don't support virtual 
functions, doesn't this pretty much force you to use classes and 
therefor GC if you want virtual functions?

So why don't structs support virtual funtions? I would like to 
have a type that is not GC'd or ref counted or any other 
nonsense, but supports virtual functions..

Am I missing something here? Thanks


More information about the Digitalmars-d-learn mailing list