February 11, 2019
https://issues.dlang.org/show_bug.cgi?id=19669

          Issue ID: 19669
           Summary: There is no way for code to detect whether -dip1000 is
                    enabled or not
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: monkeyworks12@hotmail.com

Currently, there is no way for code to tell whether the -dip1000 switch has been passed to the compiler. This makes it harder to write code that needs to do something different depending on whether dip1000 is in effect or not, and in my opinion, is REQUIRED for any non-trivial code base that wants/has to support legacy compiler versions.

There is a hacky workaround:

static assert(!__traits(compiles, {
    char[] f()
    {
        char[2] x;
        return x[].splitterASCII!(_ => _ == ' ').front;
    }
}));

But it would be far preferable to be able to use `version(dip1000)` or `static
if (dip1000)`.

--