I have this code (diamond problem):
#include
using namespace std;
struct Top
{
void print() { cout << \"Top::print()\" << e
Actually, giving code is working fine as I tried it on Visual Studio 2019. There are two way to solve Diamond Problem; - Using Scope resolution operator - Inherit base class as virtual
Calling print function by b.Right::Top::print() should be executed with no errors. But there is still two objects of your base class (Top) referred from your Bottom class.
You can find additional detail in here