Skip to content

Instantly share code, notes, and snippets.

@sinfu
Created October 14, 2010 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinfu/626877 to your computer and use it in GitHub Desktop.
Save sinfu/626877 to your computer and use it in GitHub Desktop.
void main()
{
void f() pure
{
}
enforce(100, &f);
}
T enforce(T, DG)(T v, DG dg) pure
if (is(DG == void delegate() pure))
{
dg();
return v;
}
T enforce(T, DG)(T v, DG dg)
if (is(DG == void delegate()))
{
dg();
return v;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment