Exercise: CRTP-derived Class Restriction

Test your understanding of CRTP-derived class restrictions.

We'll cover the following

Problem statement

Let’s take a look at the following code. If we analyze it closely, we can see that the derived class Derived2 has Derived1 as the template parameter. Your task is to update the code to prevent a derived class from not having itself as a template parameter.

Get hands-on with 1400+ tech skills courses.