> That won't work for narrow strings.

```D
foreach (ref ElementType!Range e; range)
    unaryFun!(e);
```
This is the approach used in `count`:
https://github.com/D-Programming-Language/phobos/blob/9404dd477fd59925acd958cb0cf21711890420d7/std/algorithm.d#L6663