Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!att!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: Operator overloading with abstract classes Message-ID: <9367@alice.UUCP> Date: 17 May 89 06:15:22 GMT References: <11468@bloom-beacon.MIT.EDU> Distribution: comp.lang.c++ Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 15 In article <11468@bloom-beacon.MIT.EDU>, sorensen@athena.mit.edu (Alma G. Sorensen) writes: > I can't do this now because "it is not possible to define an > operator function that operates exclusively on pointers." > [Stroustrup, p 172.] I can't see the right way to use an abstract > class without pointers, but if I use pointers, I can't do operator > overloading. Help! Is there some way to get both? Define a pair of classes. One contains the stuff you're working with, the other contains only a pointer. This gives you a class that you can cause to look almost like a pointer, and you can overload it as you like. -- --Andrew Koenig ark@europa.att.com