Where did you see virtual void print() = 0; ? See updated post. What kind of "undefined behavior" can happen here? nullptr can happen and it will be handled correctly, right?
virtual void print() = 0;
nullptr