Article View: gnu.g++
Article #431overloading operators on pointers to a class
From: FISK%BOWDOIN.BITNET
Date: Tue, 09 May 1989 20:31
Date: Tue, 09 May 1989 20:31
11 lines
851 bytes
851 bytes
I would like to overload an operator that is defined on pointers
to a class. Here is what I would like to do. Is this possible?
struct M { ... };
typedef struct M* P;
P a,b,c;
a = b+c // the "+" should be something like P::operator+(P,P)
--
Steve Fisk Department of Mathematics
207-725-3574 Bowdoin College
fisk@bowdoin.bitnet Brunswick, Me. 04011 USA
Technical Details
Message-ID:
<8905091935.AA26577@AENEAS.MIT.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MITVMA.MIT.EDU!FISK%BOWDOIN.BITNETShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MITVMA.MIT.EDU!FISK%BOWDOIN.BITNET From: FISK%BOWDOIN.BITNET@MITVMA.MIT.EDU Newsgroups: gnu.g++ Subject: overloading operators on pointers to a class Message-ID: <8905091935.AA26577@AENEAS.MIT.EDU> Date: 9 May 89 20:31:00 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 11