Review of Andrei's std.benchmark
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sat Sep 22 06:04:09 PDT 2012
On 9/22/12 8:28 AM, "Øivind" wrote:
> Is there a way to solve the dependency issue without forbidding static
> constructors in modules with cyclic dependencies?
I think an idea just occurred to me. The rules for static ctors and
dtors were invented before "import" was allowed inside a scope. We could
have taken advantage of that.
Say we restrict symbol visibility inside static cdtors to ONLY symbols
within the current module. If some static cdtor needs a symbol from a
different module, it must import it explicitly (even if the current
module already imports it).
In this setup it should be possible to compute, in a fine-grained
manner, the dependencies of static cdtors.
Unfortunately that would be a breaking change.
Andrei
More information about the Digitalmars-d
mailing list