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)(in string 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 set
auto someInt = var.get!int("someInt", -1); // parameter is -1 if not set