When writing generic functions for \"iterator\" ranges I usually do:
template auto func(Iter &first, Iter &last) { using IterTy
The second is the most idiomatic one.