template specialization bug?

template specialization bug?

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:

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
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.

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.