Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created September 8, 2017 09:37
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/772faf7f5d927efd2c6f98a51ce2907f to your computer and use it in GitHub Desktop.
Save deque-blog/772faf7f5d927efd2c6f98a51ce2907f to your computer and use it in GitHub Desktop.
class Interface
{
public:
//...
std::unique_ptr<Interface> clone()
{
return std::unique_ptr<Interface>(cloneImpl());
}
protected:
virtual Interface* cloneImpl() const = 0;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment