D should be like this :)
class D
{
  private int delegate(void) _deleg;
  private int _value; //
  this(int delegate(void) d)
  {
    _deleg = d;
  }
  void write()
  {
    if(_deleg !is null)
    }
      _value = _deleg(); //
    }
    writefln(_value); //
  }
} 


Reply via email to