On Mar 22, 7:02 am, Helmut Jarausch <jarau...@skynet.bewrote:

Hi,

could anybody please explain to me what's wrong with

the following code

template <typename INT,INT Pclass Zp;

template <typename INT,INT P>

Zp<INT,Poperator-(const Zp<INT,P>& a, const Zp<INT,P>& b);

template <typename INT,INT P>

class Zp {

public:

Zp operator-() const; // that's the unary operator -

// vvvvvvvvvvvv this is binary operator -

friend Zp<INT,Poperator- <>(const Zp<INT,P>& a, const Zp<INT,P>& b);

// this produces

// error: declaration of 'operator-' as non-function

// error: expected ';' before '<' token

};

Many thanks for your help,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik

RWTH - Aachen University

D 52056 Aachen, Germany

Seems the <is not required.

friend Zp<INT,Poperator- <>(const Zp<INT,P>& a, const Zp<INT,P>& b);