Reputation: 11
I have an Abstract Class and I need to create two anonymous subclasses objects for it. I have multiple subclasses. Just write the code to create one of these objects
Upvotes: -2
Views: 475
Reputation: 409442
When you declare a class (or structure) the name of the class optional if you declare a variable, but you can still use inheritance.
Something like
class AbstractBaseClass
{
public:
virtual void abstract_function() = 0;
};
class : public AbstractBaseClass
{
public:
void abstract_function() { ... }
} my_anonymous_object;
Upvotes: 3