Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active September 8, 2017 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/cd4fe88c3a7eaa2881ee92c09ba2f45c to your computer and use it in GitHub Desktop.
Save deque-blog/cd4fe88c3a7eaa2881ee92c09ba2f45c to your computer and use it in GitHub Desktop.
struct Interface1
{
virtual std::unique_ptr<Interface1> cloneInterface1() const = 0;
//...
};
struct Interface2
{
virtual std::unique_ptr<Interface2> cloneInterface2() const = 0;
//...
};
class Implementation : public Interface1, public Interface2
{
public:
virtual std::unique_ptr<Interface1> cloneInterface1() const override { /* ... */ }
virtual std::unique_ptr<Interface2> cloneInterface2() const override { /* ... */ }
//...
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment