assert that `!_input.empty`. There is no reason to actually run this test in release. What's more, the way you are doing it just silently avoids the problem:

```D
//start with the check
assert(!_input.empty);
 /* or */
version(assert)
    if (_input.empty)
        throw new RangeException;

//Then do only a static if
static if (pipeOnPop)  
{  
    func(_input.front);  
}

//Finally, pop  
_input.popFront();  
```

Also, `static if`