On Wednesday, 16 May 2012 at 20:48:27 UTC, H. S. Teoh wrote:
What about:auto noThrow(T,U...)(scope T function(U) t) nothrow { return (cast(T function(U) nothrow)t)(); } auto noThrow(T,U...)(scope T delegate(U) t) nothrow { return (cast(T delegate(U) nothrow)t)(); } ?(I've no idea if this actually works, but it does allow you to wrapalmost _any_ function.) T
Haha maybe, idk. I just wrote what I wrote so that I could use it like:
noThrow({
// giant block of code
});
to execute it as nothrow.
