automatic function call after closing block

Frank Benoit keinfarbton at googlemail.com
Sat Sep 20 09:35:09 PDT 2008


Saaa schrieb:
> I'd like the following:
> 
> texture.bind() //class texture, method bind.
> {
>     ..
> } //here texture.unbind would automatically be run.
> 
> Is this possible?
> 
> 
> 
> 


void bind( Texture t, void delegate() dg ){
  t.bind();
  dg();
  t.unbind();
}


bind( texture, {
  ...
});


More information about the Digitalmars-d-learn mailing list