The line that doesn't compile is actually in the class declaration ie :-
class CFoo
{
public:
        CFoo() {};
        bool operator != (const CFoo& s1, const CFoo& s2);
};

Thanks
Roger

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Mark
Wilden
Sent: 24 November 2002 23:15
To: Palm Developer Forum
Subject: Re: Operator overload compiler problem


From: "Roger Womack" <[EMAIL PROTECTED]>

> bool operator != (const CFoo& s1, const CFoo& s2);
>
> but the compiler gives the following :-
>
> Error   : illegal 'operator' declaration
> stdafx.h line 50    bool operator != (const CFoo& s1, const CFoo& s2);

Looks like CFoo hasn't been declared. Try

  class CFoo;
  bool operator != (const CFoo& s1, const CFoo& s2);


--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to