When working with virtual functions, we can encounter situations where we need to return a different type from an overriding function.
While this isn't possible in the general case, the types returned are allowed to be different if they are covariant (the overriding function returns a derived type).
The prototypical use for covariant return types is a clone() function.
Compiler Explorer link: https://compiler-explorer.com/z/qTxErsxbE