pass class type arguments to functions by const references