Could you also add `cast(Char*)` in there? Without it, `p` would be typed as simply `void*`. At that point, I'm surprised `return p - s.ptr;` compiles at all. Good for us if it does I guess, but typed pointers is always better than void pointers.