🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.lang.c++
Article #190

Re: Mitgliedsfunktionen als Funktionsargument?

#190
From: Enno Sandner
Date: Tue, 01 Aug 1995 18:42
18 lines
1059 bytes
Der korrekte Typ einer Memberfunction der Klasse theClass, die keine
Argumente erwartet und eine Ganzzahl liefert, ist 'int (theClass::*)();'
Zum Aufruf benoetigt man eine Instanz von 'theClass' oder einer Unterklasse,
z.B:

class theClass
{
 public:
  int call() {
    int (theClass::*function)(); // definieren
    function=&theClass :: boing; // zuweisen
    int i=(this->*boing)();      // aufrufen
  }
  int boing() { return 4711; }
};
 
	Gruss
		Enno
Technical Details
Message-ID: <ENNO.95Aug1204210@kitz.inferenzsysteme.informatik.th-darmstadt.de>
Path: arc1-ca.pugleaf.net!news.th-darmstadt.de!news!enno
References: <3vl5o5$qb3@brachio.zrz.TU-Berlin.DE>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.th-darmstadt.de!news!enno
From: enno@inferenzsysteme.informatik.th-darmstadt.de (Enno Sandner)
Newsgroups: de.comp.lang.c++
Subject: Re: Mitgliedsfunktionen als Funktionsargument?
Date: 01 Aug 1995 18:42:10 GMT
Organization: Fachbereich Informatik, TH Darmstadt
Distribution: world
Message-ID: <ENNO.95Aug1204210@kitz.inferenzsysteme.informatik.th-darmstadt.de>
References: <3vl5o5$qb3@brachio.zrz.TU-Berlin.DE>
NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
In-reply-to: ured0533@mailszrz.zrz.tu-berlin.de's message of 1 Aug 1995 12:12:53 GMT