Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

template specialization bug?

icehawk
Beginner
422 Views
Hi I'm using icc 7.0 and encountered the following problem.

I've written a Matrix template and overloaded the
* operator for matrix multiplication. The multiplication
routine split's the multplication down to 1 x n * n x 1
multiplications which is specialized.

This looks like the following:

a.)
template T operator * (const CMatrix<1, n, T> m1, const CMatrix m2) { ... }

This works really fine till this point.
But later on I've added a definition for Vertices that looks like this

template struct CVector {
typedef CMatrix<1, n, T> RowVector;
typedef CMatrix ColumnVector;
};

now replacing a.) with
b.)
template T operator * (const CVector::RowVector m1, const CVector::ColumnVector m2) { ... }

causes the following problem:

icc 7.0 won't specialize the 1xn * nx1 multiplication any more. Instead of using the specialization it trys using the general * defined in CMatrix.

With gcc it works fine.
I can't imagine that a.) and b.) are semantical different.

Hope anyone can help or acknowledge that it's a bug.
0 Kudos
0 Replies
Reply