I like the name `assertOrThrow`. :)

```D
template assertOrThrow(T : Throwable)(bool condition, lazy string msg)
{
    version(assert)
        void assertOrThrow()
        {
            if (!condition) throw new T(msg);
        }
    else
        void assertOrThrow() {}
}
...
assertOrThrow!RangeError(!array.empty);
```
Or something like that.