The only time this would be useful would be if you created multiple instances of the template with different types withing the one function. Move your private classes out of your functions anyway. If that starts to clutter up your classes then they are too big and need to be refactored.