kyllingstad/phobos — comment on commit 8de508a96856146167c7505313b92f3b1a4f4105
File:  line 0
By schveiguy:

Cued by your comment on the commit, I examined dirName, and I found:

1. The current code is unsafe (it can do a direct cast of immutable(char)[] to char[])
2. The enum is only used on the next line. You can safely get rid of the enum I think.

You really only have two choices for returning from getDir without templating on constancy:
1. Return inout(C)[], but you must dup "." when returning it since it might be cast back to mutable C[].
2. Return const(C)[].