Skip to content

Instantly share code, notes, and snippets.

@zma
Created March 30, 2015 07:16
Show Gist options
  • Save zma/0921407d33d0104f6e08 to your computer and use it in GitHub Desktop.
Save zma/0921407d33d0104f6e08 to your computer and use it in GitHub Desktop.
ambiguous-casting.cc
class A { };
class B { };
class C: public A { };
class D: private C, public A, public B { };
int main ()
{
D *d = new D;
A *a1 = dynamic_cast<A *>(d);
A *a2 = static_cast<A *>(d);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment