Hello everyone,
I just ran into the problem, that I need a static variable, where the initialisation code for that variable is only accessible during run-time (since part of the initialisation code will be dynamically linked).

Is there a way to do this in D?

To be a bit more concrete, this is where I have the problem (where ℚ uses GMP, which is dynamically linked):

struct ℚInf {
   ℚ qval;
   immutable static ℚInf zero = ℚInf(0,1);
   this(long num, long den) {
qval = ℚ(num,den); //this initialisation requires dynamically linked code
    }
}

Reply via email to