home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!agate.Berkeley.EDU!sethg
- From: sethg@roar.CS.Berkeley.EDU (Seth C. Goldstein)
- Newsgroups: gnu.g++.help
- Subject: what is a "contravarience violation for method types"
- Date: 23 Nov 92 11:32:33
- Organization: /home/auspex/b/threadid/sethg/.organization
- Lines: 35
- Distribution: world
- Message-ID: <SETHG.92Nov23113233@roar.CS.Berkeley.EDU>
- NNTP-Posting-Host: roar.cs.berkeley.edu
-
- When compiling the following with g++-2.3.1 I get warnings of the form:
-
- quad.C: In method `Toplevel::Toplevel ()':
- quad.C:27: warning: contravariance violation for method types ignored
-
- What does it mean?
-
- example:
- ////////////////////////////////////////////////////////////////////////
- class Frame;
- typedef void (Frame::*Codeblock)(void);
-
- class Frame
- {
- protected:
- int counter;
-
- public:
- inline Frame(Codeblock function);
- };
-
- class Toplevel : Frame
- {
- int i;
- public:
- Toplevel(void);
- void runtop(void);
- };
-
- Toplevel::Toplevel(void) : Frame(&(Toplevel::runtop)) // line 27
- {
-
- }
-
- -seth
-