automatic function call after closing block

Denis Koroskin 2korden at gmail.com
Sat Sep 20 09:18:42 PDT 2008


On Sat, 20 Sep 2008 20:15:17 +0400, Saaa <empty at needmail.com> wrote:

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

Yep!

texture.bind()
{
    scope(exit) texture.unbind()
    ...
}


More information about the Digitalmars-d-learn mailing list