On Tuesday, 26 August 2014 at 19:39:26 UTC, Marco Leise wrote:

As much as I see this as non-negotiable, (chancellor Merkel
would have said "alternativlos",) I know it would currently
require the whole log system to be nothrow @nogc and we may
not want to wait till allocating and throwing is allowed
during GC sweeps, before we get std.log.

nothrow I get, but nothrow in dtors is a much wider topic (please open a new thread if you want to discuss this) and see my example to hack around it.

but no nogc should be no problem as long as you use a Logger that doesn't allocate for logging, as for example FileLogger. And even than, what is the problem with no nogc logging in dtors?

--------------
class Foo {
    ~this() {
        try {
            log("Foo"); // log to file
        } catch(Exception e) {}
    }
}
--------------

Reply via email to