www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/08/11/20:15:59

Date: Thu, 11 Aug 1994 14:55:05 -0700 (PDT)
From: Gordon Hogenson <ghogenso AT u DOT washington DOT edu>
Subject: Re: Internal function pointers
To: William Hughes <wrh AT placer1 DOT wimsey DOT com>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

On Thu, 11 Aug 1994, William Hughes wrote:

[code deleted]

> Note that this works fine if myfunc is not within the class,
> but someone else's function.  It only gripes when myfunc is
> part of the class.
 
> Should this be happening, or am I just abusing the structure of c++
> way, way, way too much...? 

I'm afraid you're abusing the structure of c++.  The problem is that
myfunc is of type "void (x::*)(void)" not "void (*)(void)".
I.e., pointers to (nonstatic) member functions and pointers to 
nonmember functions do not mix.  This is partly because member 
functions take an implicit "this" pointer which regular functions 
do not have.

Gordon


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019