delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/12/14:55:32

From: "Campbell, Rolf [SKY:1U32:EXCH]" <cp1v45 AT americasm01 DOT nt DOT com>
Newsgroups: comp.os.msdos.djgpp,comp.lang.c++
Subject: Casting a class as a function pointer.
Date: Mon, 12 Jul 1999 14:12:14 -0400
Organization: Nortel Networks
Lines: 18
Message-ID: <378A2FFE.D9A4F8A0@americasm01.nt.com>
NNTP-Posting-Host: bmerhc00.ca.nortel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.6 [en] (X11; I; HP-UX B.10.20 9000/712)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Is there any way to make an operator method that catches casts to a
function pointer without a typedef?

I've tried this:
struct a {
  int a; int b;
  operator (int(*)(int)) ();
  };

But, it didn't work in gcc v2.8.1 for HP-UX.  Making a typedef works fine,
but I need to know if it is possible without a typedef.


--
     -Rolf Campbell (39)3-6318



- Raw text -


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