Getting RefCounted to work with classes

Bienlein via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Aug 25 23:47:53 PDT 2014


On Tuesday, 26 August 2014 at 06:01:25 UTC, uri wrote:

> RefCounted does not work with classes. Classes are reference 
> types already.

Yep, that's the problem. I also got some suspicion, then surfed 
the Internet and found the information about it. Thanks for 
explaining the error message to me. Now it even seems obvious to 
me what it wants to say ;-).

But you can define a var inside a struct that holds a class and 
this way I got it working with my class as well thanks to 
generics in D. Woohoo!


More information about the Digitalmars-d-learn mailing list