Reputation: 166
I am writing a class representing a Matrix and encountered an error: "expected ‘)’ before ‘<’ token" on the second to last line.
template<typename T>
class Matrix;
template<typename T>
Matrix<T> operator-(const Matrix<T> &self);
template<typename T>
ostream & operator<<(ostream &out, const Matrix<T> &matrix);
template<typename T> class Matrix
{
public:
friend ostream & (operator<<<> )(ostream &out, const Matrix &matrix);
friend Matrix (operator-<>)(const Matrix &self); //error here
};
Upvotes: 0
Views: 40
Reputation: 166
Must have been a bug with eclipse using Linux GCC. Solved it by compiling with a different compiler.
Upvotes: 1