Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
struct Interface
{
virtual Interface* clone() const = 0;
//...
};
class Implementation : public Interface
{
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