Andrei Alexandrescu Wrote: > > It's simpler actually: > > debug void assert(T)( T expr, string delegate() msg ) { > if(!expr) > throw new Exception(msg); > } > else void assert(T)( T delegate(), string delegate() ) { > } > > Hm, actually it's more complicated than your version :o). > > > Andrei
You should be throwing AssertError I really like lazy for log messages and asserts. I like the implicit cast to (scope) pure delegate idea. It works well in those contexts. How hard would it be to use a library assert in ctfe context?