On 30.05.2012 17:14, Regan Heath wrote:
synchronized class Container
{

void applyLocked(scope delegate void(Container _this));
...
}

Neat :)

Rewritten and almost complete:

synchronized class Locked!(C)
{
        void applyLocked(scope delegate void(C _this) dg)
        {//should have lock/unlock already, as every sync'ed class
                gd(_this);      
        }

        final auto opDispatch(string mtd, Args...)(Args args)
        {//can't go alias this, it won't be locked I think
                return mixin("_this."~mtd~"("~args~")");
        }
private:
        C _this;
}


--
Dmitry Olshansky

Reply via email to