Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
struct Interface1
{
virtual Interface1* clone() const = 0;
//...
};
struct Interface2
{
virtual Interface2* clone() const = 0;
//...
};
class Implementation : public Interface1, public Interface2
{
public:
virtual Implementation* clone() const override
{
return new Implementation(*this);
}
//...
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment