home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 20032 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.5 KB

  1. Xref: sparky comp.lang.c++:20032 comp.object:5096
  2. Path: sparky!uunet!ogicse!cs.uoregon.edu!sgiblab!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
  3. From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
  4. Newsgroups: comp.lang.c++,comp.object
  5. Subject: Re: HELP : Array of objects of diff classes ??
  6. Message-ID: <1993Jan27.143040.17236@ucc.su.OZ.AU>
  7. Date: 27 Jan 93 14:30:40 GMT
  8. Article-I.D.: ucc.1993Jan27.143040.17236
  9. References: <1993Jan19.112059.2882@ucc.su.OZ.AU> <20665@durer.cme.nist.gov>
  10. Sender: news@ucc.su.OZ.AU
  11. Organization: MAXTAL P/L C/- University Computing Centre, Sydney
  12. Lines: 23
  13. Nntp-Posting-Host: extro.ucc.su.oz.au
  14.  
  15. In article <20665@durer.cme.nist.gov> schnee@sail.ncsl.nist.gov (Rick Schneeman) writes:
  16. >John MAX Skaller (maxtal@extro.ucc.su.OZ.AU) wrote:
  17. >: 
  18. >:     Use a discriminated union. Oh, C++ doesn't have one,
  19. >: so emulate one with an idiom.  Below I use pointers for 
  20. >: illustration, you can put copies of the actual objects in
  21. >: if you like (just get rid of appropriate *'s)
  22. >: 
  23. >
  24. >Well done example, I would add that this is termed a GENERIC
  25.  
  26.     A constrained generic: it differs from unconstrained generics
  27. for which C++ has template support.
  28.  
  29. >which can be implemented in C++ in a variety of ways. 
  30.  
  31.     As usual :-)
  32.  
  33. -- 
  34. ;----------------------------------------------------------------------
  35.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  36.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  37. ;------ SCIENTIFIC AND ENGINEERING SOFTWARE ---ph:  2 799 8223 --------
  38.