return val if

Abby loniro7678 at twit-mail.com
Sun Mar 22 18:48:32 UTC 2020


Is there a way to create a template that would do the same is glib

g_return_val_if_fail() 
(https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions.html#g-return-val-if-fail)

I was hoping something like this would work

template returnValIfFail(alias expr, alias val)
{
     if(expr) return val;
}


More information about the Digitalmars-d-learn mailing list