I uploaded it hereI've begun work on this and my implementation in D passes all
https://github.com/nordlow/justcxx/blob/master/levenshtein_distance.hpp
I don't have time right now to look into adapting it to Phobos.
But I hope it can give some clues for your work ;)
/Per