On CRTP with multi-level inheritance, cloning, and the constructor forwarding problem.
by Katy Coe
From the article:
A common problem in C++ occurs when you have an object of an unknown derived type and want to make a copy of it. ...
The solution is to use the commonly-used polymorphic cloning pattern. In this pattern, we define a virtual function -- which we’ll call
clone()in this article -- which when called via an object pointer returns a new object of the correct derived type.