hi, again! i need some help... i am doing a
singleton class (templated with Destructors).
the problem is that i don't know how to pass a D
pointer to function to the c function atexit (std.c.stdlib)!!!
[compiler says: function atexit (void(C*)()) does
not match argument types (void(*)()) ]
private import
std.c.stdlib;
extern (C) int atexit(void
(*)());
interface IDestructor
{
public:
void
create(void (*dtor)());
}
class DestructorAtExit :
IDestructor {
public:
void create(void (*dtor)()) { atexit(dtor); }
}
thanks,
Miguel Ferreira Simões