On 2/25/19 2:09 AM, Nicholas Wilson wrote:
Leaving aside the issue of why DMD can't handle this, the entire reason
pragma(inline, bool) takes a bool is for it to be (potentially) predicated.
In this case you want:

version(DigitalMars)
      private enum inline_overlaps = false;
else // assuming GDC is good
      private enum inline_overlaps = true;

pragma(inline, inline_overlaps)
bool overlaps(IntervalType1, IntervalType2)(IntervalType1 int1, IntervalType2 int2)
{
      return ...;
}

Sadly, the pragma does not accept enum:

Error: pragma `inline` pragma(inline, true or false) expected, not inline_overlaps

Reply via email to