module clox.util; import std.stdio; import std.traits : isUnsigned; import std.container.array; import std.functional : unaryFun; T validateAssert(alias pred = "!!a", T)(T v, lazy string msg = null) nothrow { try{ string m = msg; static if(is(typeof(pred) == string)) m = msg ? msg : pred; assert(v.unaryFun!pred, m); return v; } catch(Exception){ assert(0); } }