#include #include #include #include "date0.h" #include "date3.h" #include "date1.h" using namespace std; void f(date0 *p); int main() { date3 d3 {4, 10, 2025}; //There is a date0 inside of a date3. date1 d1 {4, 10, 2025}; //There is a date0 inside of a date1. //date0 d0 {4, 10, 2025}; //will no longer compile because it's abstract f(&d1); f(&d3); return EXIT_SUCCESS; } void f(date0 *p) //Can still have a pointer to a date0 { cout << *p << "\n"; }