factor out iterator distance/enumerate from range distance/enumerate