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