Created
May 1, 2014 16:53
-
-
Save madbence/e51436fac9324b36cd6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct foo { | |
virtual int bar() = 0; | |
virtual int baz() = 0; | |
}; | |
struct qux: public virtual foo { | |
int bar() { | |
return baz(); | |
} | |
}; | |
struct woof: public virtual foo { | |
int baz() { | |
return 66; | |
} | |
}; | |
template<class A, class B> | |
struct garply: public A, public B {}; | |
int main() { | |
foo* obj = new garply<qux, woof>(); | |
return obj->bar(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment