The short answer is "you do not."
To simplify the implementation of what you want to do ( randomA act differently for N=1 ), you would need to write const TransitionMatrixTemplate<N, M> randomA() in the parent CRTP element, and then partially specialize this for N=1 .
template<typename D, int N, int M, int K> struct Bob_Base { static_assert( std::is_base_of< D, Bob_Base<D, N, M, K> >::value, "D must be derived from Bob_Base" ); D* self() { return static_cast<D*>(this); D const* self() const { return static_cast<D*>(this); const TransitionMatrixTemplate<N, M> randomA() {
this is important only if the code where N==1 cannot compile (or vice versa).
source share