Let’s say i’ve got a templated class called model. now let’s declare a class within this class called texture, that requires no template arguments. How do i go about defining it so that no matter the template argument given to the Model class, the texture object is the same. This is what it looks like.
template<class T>
class Model
{
class Texture;
};
class Model::Texture //error because model requires a template argument.
{
};
so is there anything i can do here?
You should have to write that this way:
As
Modelis a class template, so hereTapplies toModelonly.Textureis still a non-template.Online demo