Skip to content

Instantly share code, notes, and snippets.

@madbence
Created May 1, 2014 16:53
Show Gist options
  • Save madbence/e51436fac9324b36cd6e to your computer and use it in GitHub Desktop.
Save madbence/e51436fac9324b36cd6e to your computer and use it in GitHub Desktop.
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