You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why don't you add a function like this into TempleContext? (This snippet does not work because of some Temple's template magic which I couldn't understand)
T get(T)(instring name, lazy T defValue=T.init)
{
return (name in vars) ? vars[name].get!T : defValue;
}
It is for convenient usage like:
auto someBool = var.get!bool("someBool", false); // parameter is false if not setauto someInt = var.get!int("someInt", -1); // parameter is -1 if not set
The text was updated successfully, but these errors were encountered:
Why don't you add a function like this into TempleContext? (This snippet does not work because of some Temple's template magic which I couldn't understand)
It is for convenient usage like:
The text was updated successfully, but these errors were encountered: