template deferEnsure(string value, string condStr, string msg = "")
enum deferEnsure =
"{ enum long _deferAssert_line = __LINE__;\n" ~ " try\n" ~ " {\n" ~ " auto _ = (" ~ value ~ ");\n" ~ " bool _deferAssert_condResult = (" ~ condStr ~ ")?true:false;\n" ~ " _deferEnsure!(_deferAssert_line, __FILE__, " ~ value.stringof ~ ", " ~ condStr.stringof ~ ", _deferAssert_ExprTypeOf!(typeof(" ~ value ~ ")), " ~ msg.stringof ~ ")(_, _deferAssert_condResult);\n" ~ " }\n" ~ " catch(Throwable _deferAssert_e)\n" ~ " _deferEnsureException!(_deferAssert_line, __FILE__, " ~ value.stringof ~ ", " ~ condStr.stringof ~ ", " ~ msg.stringof ~ ")(_deferAssert_e);\n" ~ "}\n";