template<typename T>
class A
{
public:
T a;
A(const T& _a=0)
:a(_a)
{
}
class B
{
public:
T b;
B(const T& _b=0)
:b(_b)
{
}
B& get();
};
};
template<typename T>
A<T>::B& A<T>::B::get()
{
return *this;
}
int main()
{
A<int>::B b;
b.get();
return 0;
}
MinGW Developer Studio给了两个警告:
main.cpp:27: warning: `A<T>::B' is implicitly a typename
main.cpp:27: warning: implicit typename is deprecated, please see the
documentation for details
什么意思?如何修正?
class A
{
public:
T a;
A(const T& _a=0)
:a(_a)
{
}
class B
{
public:
T b;
B(const T& _b=0)
:b(_b)
{
}
B& get();
};
};
template<typename T>
A<T>::B& A<T>::B::get()
{
return *this;
}
int main()
{
A<int>::B b;
b.get();
return 0;
}
MinGW Developer Studio给了两个警告:
main.cpp:27: warning: `A<T>::B' is implicitly a typename
main.cpp:27: warning: implicit typename is deprecated, please see the
documentation for details
什么意思?如何修正?
