the code at 20:53 gives the following error: error:'C::C()' is protected similar thing for the destructor of C. Also, there's no such error for the constructor and destructor of B although they are also protected.
I understood later. The error is due to the creation of C data_ in D which is not allowed since constructor of C is protected which D can access only for creating an instance of D. Further can be clarified if you delete "C data_;" and try to run the code and see the output.
the code at 20:53 gives the following error:
error:'C::C()' is protected
similar thing for the destructor of C.
Also, there's no such error for the constructor and destructor of B although they are also protected.
I understood later. The error is due to the creation of C data_ in D which is not allowed since constructor of C is protected which D can access only for creating an instance of D. Further can be clarified if you delete "C data_;" and try to run the code and see the output.