Skip to content

Instantly share code, notes, and snippets.

@neel
Created February 3, 2015 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neel/53927a1d86bd4f7557a8 to your computer and use it in GitHub Desktop.
Save neel/53927a1d86bd4f7557a8 to your computer and use it in GitHub Desktop.
#include <iostream>
struct A{
void f(){
std::cout << "A" << std::endl;
}
};
struct B: public virtual A{
void f(){
std::cout << "B" << std::endl;
}
};
struct C: public virtual A{
void f(){
std::cout << "C" << std::endl;
}
};
struct D: public B, public C{
void main(){
f();
}
};
int main(){
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment