Add throughout the code tests to check whether `parent` alias is truly a parent
When refactoring, it may happen the inheritance change but it is possible to forget to replace the alias accordingly.
For instance in VariationalFormulation
class:
template
<
class DerivedT,
std::size_t SolverIndexT,
enable_non_linear_solver NonLinearSolverT = enable_non_linear_solver::no
>
if the third argument is set to yes
in a refactoring the parent
alias must be updated.
Putting the test:
static_assert(std::is_convertible<self*, parent*>());
ensures at compile time it remains true (when parent
is a public parent - see this Cpp reference link to an explanation of why this test is often the right choice.