Safety/purity and assert/enforce error messages

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Thu Sep 12 14:37:10 PDT 2013


On 12/09/13 22:23, Jonathan M Davis wrote:
> You can put the try-catch in a version(assert) block to get around that
> problem, but it is true that it's not exactly ideal. However, there really
> isn't any way around that with a function that takes a format string unless
> you want it to ignore bad arguments. You'd need a function like text which
> just appends all of its arguments together in order to get around that
> problem.

Well, I have been using text() to generate my assert error messages, but the 
trouble is that (at least in 2.063) it's not @safe, pure or nothrow ... :-(



More information about the Digitalmars-d-learn mailing list