struct IHoge {
virtual ~IHoge(void) {}
virtual void func(void) = 0;
};
struct IFuga {
virtual ~IFuga(void) {}
virtual void func(void) = 0;
};
struct Foo : IHoge , IFuga {
void func(void) { std::cout << "helloworld" << std::endl; }
};
int main(void) {
Foo * p = new Foo;
IHoge * h = p;
IFuga * f = p;
p->func();
h->func();
f->func();
delete p;
return 0;
}