Linear algebra module
Since you are using matrices, I don't think that you need the runtime polymorphic behaviour offered by virtual but that you created virtual functions so that you could call methods of the derived class from methods of the base class. If this is the case, you could use static polymorphism instead, thanks to the Curiously Recurring Template Pattern idiom (CRTP).

In other words, make DenseBase take a Derived template parameter which corresponds to the type of the derived class:

template &lt;typename T, std::size_t M, std::size_t N, typename Derived&gt;
class DenseBase
{
    // ...
}


Then make the derived classes feed their own type to this template parameter:

template &lt;typename Parent, typename T, std::size_t N&gt;
class Rowview : public DenseBase&lt;T, 1, N, Rowview&lt;Parent, T, N&gt;&gt;
{
    // ...
}


Now, add a couple of methods to DenseBase to make a downcast when needed. Since you know the derived type at compile time thanks to the template parameter Derived, you can make a safe downcast with a static_cast:

Derived&amp; derived() { return static_cast&lt;Derived&amp;&gt;(*this); }
const Derived&amp; derived() const { return static_cast&lt;Derived&amp;&gt;(*this); }


Now you can rewrite the coeff methods in DenseBase so that they don't need to use virtual anymore to call the coeff methods from the derived class:

T&amp; coeff(std::size_t row, std::size_t col) { return derived().coeff(row, col); }
const T&amp; coeff(std::size_t row, std::size_t col) const { return derived().coeff(row, col); }

T&amp; coeff(std::size_t index) { return derived().coeff(index); }
const T&amp; coeff(std::size_t index) const { return derived().coeff(index); }


That way, you have some of the benefits of polymorphism without having to pay the cost of runtime polymorphism which I feel you won't need for such a class. That's a little bit tricky to understand and use at first, but it has clear benefits.