void f() nothrow
{
import std.conv : to;
try
{
// do something
}
catch(Throwable th)
{
auto err = th.toString;
}
}
I can't use err variable, it result in error:
function object.Throwable.toString is not nothrow
obviously, insert a try-catch() within catch() is a circular
dependence and doesn't solve the problem either (even if it, I
think it would be quite ugly)
I have to make my function nothrow because the function that
calls it (not written by me) is nothrow. So I need to wrap my
code in a try-catch() but how will I report the error message, if
the toString() from Throwable isn't nothrow? how do I get out
this circular dependence?
- how to make this function not... Jack via Digitalmars-d-learn
- Re: how to make this fun... Adam D. Ruppe via Digitalmars-d-learn
- Re: how to make this fun... Ali Çehreli via Digitalmars-d-learn
- Re: how to make this fun... Steven Schveighoffer via Digitalmars-d-learn
- Re: how to make this... Jack via Digitalmars-d-learn
