resolve template parameter type in function and move scope definition to forwarding header