You didn't specify if ReturnType was a class/typename or an existing type.
And no, you can't really do that at all...but,you can specialize templates:
1 2 3 4 5 6 7 8 9 10
template<typename T>
T CreateObject()
{
return(new T);
}
template<> //this will be a template specialization that is
int CreateObject<int>() //specialized for an int
{
return(1337);
}
Thus, CreateObject<string>() returns a new string, whereas CreateObject<int>() returns 1337.