I have a simple and reproducible code, which looks like so:
template <typename T>
class Proxy {
private:
Wrap<T> &self; // If I comment this, it will work
public:
Proxy() {}
};
template <typename T>
class Wrap {
T *p;
public:
Proxy<T> foo() {
return Proxy<T>();
}
};
int main()
{
return 0;
}
The error I get is:
'Wrap' does not name a type
If I comment Wrap<T> &self
, then it will work, but this is not what I need. I need Wrap<T>
to be a member of Proxy
class. How can I achieve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…