$ cat test.cpp
template<typename T>
class test{
public:
typedef unsigned T unsig;
};
int main(){
test<int>::unsig var=0;
return 0;
}
$ g++ test.cpp -o test
test.cpp:4: error: invalid combination of multiple type-specifiers
test.cpp: In function ‘int main()’:
test.cpp:8: error: ‘unsig’ is not a member of ‘test<int>’
test.cpp:8: error: expected `;' before ‘var’
Пример совершенно безумный, да. Вопрос в том, как добраться до типа, определенного в темплейтном классе.