home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: Help W/ Generics in C++
- Message-ID: <1992Jul21.152723.23194@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <1992Jul20.132106.1@vmsb.is.csupomona.edu>
- Date: Tue, 21 Jul 1992 15:27:23 GMT
- Lines: 27
-
- In article <1992Jul20.132106.1@vmsb.is.csupomona.edu> cvadrsvk@vmsb.is.csupomona.edu writes:
- >
- >
- >I am new to C++. I have programmed in C for about 5 years and now want to
- >use features of C++. I have also programmed in Ada to a limited extent.
- >In Ada generic packages may be created. Can someone assist me in describing
- >how this is implemented in C++. The application I am working on is the
- >implementation of a B+Tree System. I would like to be able to hand a
- >"generic" object the data structure for the records along with the operator to
- >compare the structure and have the internals of the file system completly
- >hidden.
- >
-
- Pretend you writing a class to make a B+Tree of T objects.
- Now just put
-
- template<class T>
-
- on the line before the class declaration.
- You also need to add <T> in various places to make it work.
-
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-