我在这样的类中有一个结构
template <class T>
class a {
struct b {
int var;
b *foo(const T&);
};
int var;
};
我想在 struct b
之外定义 foo
。
我该怎么做?
最佳答案
template <class T>
typename a<T>::b* a<T>::b::foo(const T&)
{
//code
}
关于c++ - 嵌套类的成员函数返回嵌套类的类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34457069/