Relative Content

Tag Archive for c++ooptemplates

Can a constructor of an instance of a template access the template of its private members?

Let’s suppose we want to make a custom Array template that can hold an Array of any type (I know there’s the standard library, but I am just learning how templates work.) We created a simple Animal class and whenever we want to create our customed array of that animal class, then we call a special constructor that would not normally be called if we created an array of any other type.