storage classes on function parameters affect the type of the function, but they do not affect the type of the parameter. If a function has a parameter named foo, then typeof(foo) is going to be the same whether ref is on it ornot. - Jonathan M Davis
Ok. But how to pass storage class to template?