没有分,一个奇异的模版编译问题。
在Vc7.1上的编译结果:
不可编译版本:
template<class T>
struct TestA
{
typedef std::vector<T> myvector;
};
template<class T>
struct TestB
{
typedef typename TestA<T> myvector;
};
typedef TestB<int> TestInt;
void __test(TestInt::myvector::myvector & v);
可编译版本:
template<class T>
struct TestA
{
typedef std::vector<T> myvectorT;
};
template<class T>
struct TestB
{
typedef typename TestA<T> myvector;
};
typedef TestB<int> TestInt;
void __test(TestInt::myvector::myvectorT & v);
我认为这是Vc7.1的BUG。
欢迎大家提出自己的见解