I want to make a class in C++, which other classes inherit from it. But I want to make sure that no one will be able to make an instance from this class.
Meaning:
class Animal{
public:
virtual ~Animal() {}
};
class Fish: public Animal{
};
I want to make sure that:
Fish* fish = new Fish();
would be possible, but
Animal* ana = new Animal();
would not.
How can I do it?
Make it an abstract class