O
Oskar Enoksson
The following template specialization construct is rejected by g++ 4.1.2
while icc 9.1 silently accepts is (even with -strict-ansi). Which
compiler is correct?
template<typename T>
struct x {};
template<typename T, unsigned N>
struct x<T*[N]> {};
int main() {
x<int> a;
x<int*[10]> b;
return 0;
}
bash> g++-4.1.2 -c tst.cpp
tst.cpp:7: error: template parameters not used in partial specialization:
tst.cpp:7: error: ‘T’
bash> icc -strict-ansi -o tst tstst.cpp
bash>
thanks
/Oskar
while icc 9.1 silently accepts is (even with -strict-ansi). Which
compiler is correct?
template<typename T>
struct x {};
template<typename T, unsigned N>
struct x<T*[N]> {};
int main() {
x<int> a;
x<int*[10]> b;
return 0;
}
bash> g++-4.1.2 -c tst.cpp
tst.cpp:7: error: template parameters not used in partial specialization:
tst.cpp:7: error: ‘T’
bash> icc -strict-ansi -o tst tstst.cpp
bash>
thanks
/Oskar