throws(statement, ErrorType)

spir denis.spir at
Sat Jan 22 20:11:44 PST 2011

How to write a predicate like:
	assert( throws(someStatement, ErrorType) );
Meaning a kind of builtin shortcut for:
	    throw new SomeCustomError();
	catch (ErrorType _) {}
that would also have the advantage of beeing usable as assert variant, 
unifying unittest checks. I constantly need that.

vita es estrany

More information about the Digitalmars-d-learn mailing list