mixin template logIt()
{
static shared this()
{
log(typeof(this).stringof ~ init);
}
static shared ~this()
{
log(typeof(this).stringof ~ deinit);
}
}
Try shared static this() and it won't run as a class constructor.
http://dlang.org/class.html#StaticConstructor
mixin template logIt()
{
static shared this()
{
log(typeof(this).stringof ~ init);
}
static shared ~this()
{
log(typeof(this).stringof ~ deinit);
}
}
Try shared static this() and it won't run as a class constructor.
http://dlang.org/class.html#StaticConstructor
Created bug ticket: http://d.puremagic.com/issues/show_bug.cgi?id=7855
--
Kind Regards
Benjamin Thaut
On Mar 26, 2012 5:11 AM, Benjamin Thaut c...@benjamin-thaut.de wrote:
Is this intended behaviour or is this a bug? I assume this happens
because of the mixin template and the public import.
I'm using dmd 2.058.
--
Kind Regards
Benjamin Thaut
I don't think the order of destructors is
On 04/08/2012 02:14 PM, Kevin Cox wrote:
On Mar 26, 2012 5:11 AM, Benjamin Thaut c...@benjamin-thaut.de
mailto:c...@benjamin-thaut.de wrote:
Is this intended behaviour or is this a bug? I assume this happens
because of the mixin template and the public import.
I'm using dmd 2.058.
--
Hi,
I came across a issue with the order in which druntime calls the module
destructors. I created a small repro case for it:
file a.d:
module a;
import logger;
shared static this()
{
log(a init);
}
shared static ~this()
{
log(a deinit);
}
file b.d:
module b;
import mix;
class Foo
{