🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #603

what is a "contravarience violation for method types"

#603
From: Seth C. Goldstein
Date: Mon, 23 Nov 1992 11:32
35 lines
1103 bytes
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
Technical Details
Message-ID: <SETHG.92Nov23113233@roar.CS.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!agate.Berkeley.EDU!sethg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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