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 ...;
}
I still have yet to internalize the power of compile-time values. Thanks
for the reminder and solution!