Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!samsung!uunet!huxley!glenn From: glenn@huxley.huxley.bitstream.com (Glenn P. Parker) Newsgroups: comp.lang.c++ Subject: Re: How To Do User-Defined Conversion? Message-ID: Date: 12 Oct 90 14:09:22 GMT References: <28717@pasteur.Berkeley.EDU> Sender: glenn@huxley.UUCP Reply-To: (Glenn Parker) Distribution: comp Organization: Bitstream, Inc. Lines: 22 In-reply-to: achoi@cory.Berkeley.EDU's message of 12 Oct 90 02:24:44 GMT In article <28717@pasteur.Berkeley.EDU>, achoi@cory.Berkeley.EDU (Andrew Choi) writes: > How do you define the operator which converts a class object to > a pointer to a function returning int? This may not be exactly what you wanted, but it works with cfront 2.0. I couldn't get it work without the typedef. class A { public: typedef int (*intfunc)(); intfunc f; operator intfunc() { return f; } }; -- Glenn P. Parker glenn@bitstream.com Bitstream, Inc. uunet!huxley!glenn 215 First Street BIX: parker Cambridge, MA 02142-1270