Automatic invariant generation
Nicholas Wilson via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jul 7 01:21:50 PDT 2017
The compiler seems to inset an `assert(this !is null, "null
this");` into my struct.
which is for all intents and purposes.
struct Foo {
Bar b;
}
struct Bar {
void* ptr;
}
I tried disabling the invariant but it complained that invariant
requires a function body.
Is there a way to disable the implicit generations of invariants
for my code other than -release? Like for a particular subset of
files (separate invocations of the compiler is not an acceptable
approach.
The reason being that I do not support global variables (of any
kind) at the moment in dcompute and the insertion of the string
literal to the assert breaks that.
More information about the Digitalmars-d
mailing list