Trying to implement a reference counting mechanism

Martin martinbbjerregaard at gmail.com
Tue Mar 19 15:10:34 PDT 2013


I was inspired by the "Unmanaged" framework, and the usage would 
be something like:

class MyClass
{
private:
     int _a;
     int _b;

public:
     this(int a, int b)
     {
         _a = a;
         _b = b;
     }
}

class OtherClass
{
private:
     RefCountedObj!MyClass _myClassInstance;

public:
     this()
     {
         _myClassInstance = RefCountedObj!MyClass.create(10, 20);
     }
}


More information about the Digitalmars-d-learn mailing list