Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!apple!rutgers!att!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c++ Subject: Re: overloading operators on pointers to a class Summary: A little harder than that ... Message-ID: <184@mole-end.UUCP> Date: 11 May 89 11:40:46 GMT References: <8905091935.AA26577@AENEAS.MIT.EDU> Organization: mole-end--private system. admin: mole-end!newtnews Lines: 16 > 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) Sorry. (Gee, I'm beginning to sound like a compiler ...) What you *can* do is define a class that can be converted to and from M* and upon which the operations are defined. -- (This man's opinions are his own.) From mole-end Mark Terribile