Function range can now be templated.