From: "Anthony.Appleyard" Organization: Materials Science Centre To: DJGPP AT DELORIE DOT COM Date: Mon, 7 Apr 1997 12:30:05 GMT-1 Subject: funny re user-defined ++ and -- operators Reply-to: Anthony DOT Appleyard AT umist DOT ac DOT uk Message-ID: <4C4D410EC4@fs2.mt.umist.ac.uk> This djgpp c++ test program:- class cat{public: int kittens,micecaught; void operator++(); void operator--();}; /*-----*/ void cat::operator++(){kittens=kittens+1;} void cat::operator--(){kittens=kittens-1;} main(){ cat Tabbins; Tabbins++; Tabbins--; ++Tabbins; --Tabbins;} caused these warnings when compiled with -Wall:- t$.cc: In function `int main()': t$.cc:9: warning: no `operator++ (int)' declared for postfix `++', using prefix operator instead t$.cc:9: warning: no `operator++ (int)' declared for postfix `++', using prefix operator instead t$.cc:10: warning: no `operator++ (int)' declared for postfix `++', using prefix operator instead t$.cc:10: warning: no `operator++ (int)' declared for postfix `++', using prefix operator instead (1) Line 10 used `--', but the warning re line 10 said `++'. (2) Do these warnings now mean that now I can declare distinct postfix and prefix ++ and -- operators to use with classes? If so, how?