Possible Duplicate:
How do you declare an interface in C++?
Hi,
What's the preferable way to create single interface and multiple implementations in c++?
For example, I'd like to implement kqueue for mac and epoll for linux and share the interface.
Thank you
#ifdef #includethe right one from a third one. This is not as elegant, but it works. The reason why I would go this way is that it is kind of pointless to use a sophisticated pattern that can decide at runtime if it is clear from the beginning that you will only ever use one implementation on a particular platform.