Use const ref on generics to please ##c++ people.