Original Post
I'm wondering if there is a way to create a templated class/method that will reliably return an instance of the parameter specified. My main problem is making it handle types as well as pointers to types. template T create() { //possible? } Is is possible to write the above such that both the following calls will work? MyClass x = create(); MyClass* y = create();