While reading an article, I came across the following syntax:
template <typename T>
class MyTemplate
{
T* member;
T* method();
// ...
}
class MyClass : public MyTemplate<MyClass>
{
// ...
}
I don't exactly understand how MyClass
can inherit from a template that's based on itself. Could you please explain how this works?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…