I have a function in a class which returns different type of objects ,
template <class T>
T Create(int i) {
if(i==0) return new B();
else return new A();
}
but this Create method must be virtual , how can I make it? I got "template may not be virtual" error. thank you
Edit: I tried : template< class T >
virtual T Create__Account(int i) = 0;