Your task is to define the following class hierarchy:
show()
Generic Device
identify()
Smart Device
The program will:
SmartDevice
Example
Output:
Generic Device Smart Device
Why this output?
Without virtual inheritance, SmartDevice would have two copies of Device.
By using virtual public, only one shared instance of Device exists.
Question Significance
This problem demonstrates how virtual inheritance solves the diamond problem when multiple paths lead to the same base.
Test Cases
Test Results
Input
Expected Output