I ran across something weird the other day. I had assumed that the return type of an overriding function must be identical to the function that it is overriding. The C++ Standard allows one specific exception to this rule that could possibly come in handy to save some unnecessary casting.
In an overridden method that returns a pointer or a reference to a class, you are allowed to change the return type to a derived class instead.

C++ Standard

The return type of an overriding function shall be either identical to the return type of the overridden function or covariant with the classes of the functions. If a function D::f overrides a function B::f, the return types of the functions are covariant if they satisfy the following criteria:

both are pointers to classes or references to classes

the class in the return type of B::f is the same class as the class in the return type of D::f or, is an unambiguous direct or indirect base class of the class in the return type of D::f and is accessible in D

both pointers or references have the same cv-qualification and the class type in the return type of D::f has the same cv-qualification as or less cv-qualification than the class type in the return type of B::f.

I look at casts as a pretty good indicator of code smell; many casts, especially dynamic, usually indicate that a redesign is in order. This probably causes me to avoid them more then necessary

This could also be one of those nice features of the language that is obscure enough that using a dynamic_cast is less likely to cause someone to waste an hour scratching their head. If you don’t come up with “covariant return type” as a search term, it may take you a while to Google it.