home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19740 < prev    next >
Encoding:
Text File  |  1993-01-22  |  986 b   |  30 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!cs.uiuc.edu!sparc0b!pjl
  3. From: pjl@cs.uiuc.edu (Paul Lucas)
  4. Subject: Re: operators
  5. Message-ID: <C197Co.JH4@cs.uiuc.edu>
  6. Keywords: operators,inheritance
  7. Sender: news@cs.uiuc.edu
  8. Organization: University of Illinois at Urbana-Champaign
  9. References: <1993Jan21.165621.16704@jussieu.fr>
  10. Date: Fri, 22 Jan 1993 11:45:59 GMT
  11. Lines: 17
  12.  
  13. In <1993Jan21.165621.16704@jussieu.fr> clerc@gla.ecoledoc.ibp.fr writes:
  14.  
  15.  
  16. >Id like to express in C++ the fact that operators < <= >= can
  17. >be defined using operators > and = (eg: a < b  is b > a)
  18. >I would use a class MathObj (that would implement < <= >= using > and =)
  19. >and derive my classes from it, redifining only the basic operators > and =
  20.  
  21.     I assume you meant: "in terms of operators > and =="
  22.                               ^
  23. >How can I WRITE that in C++ ? (no template solution please)
  24.  
  25.     Make < and == virtual in MathObj.
  26. -- 
  27.     - Paul J. Lucas
  28.       AT&T Bell Laboratories
  29.       Naperville, IL
  30.