In that case, a simpler
```D
version (assert) enforceEx!RangeError(!r.empty);
```

Could be a good idiomatic compromise.