home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!slxsys!xon!michael
- From: michael@xon.co.uk (Michael J Marshall)
- Newsgroups: comp.lang.c++
- Subject: Re: template argument as base class
- Message-ID: <1238@dorothy.xon.co.uk>
- Date: 24 Jul 92 10:39:44 GMT
- References: <20204@sbsvax.cs.uni-sb.de>
- Organization: X-ON Software - London, England
- Lines: 36
- X-Newsreader: Tin 1.1 PL4
-
- stefan@mpi-sb.mpg.de (Stefan Naeher) writes:
- :
- : Does anyone know a workaround for the following problem.
- : ...
- : A possible application is the implementation of data types with implementation
- : parameters, e.g., dictionary<skiplist>, dictionary<red_black_tree>, ....
-
- Perhaps try something like:
-
- template <class T> class container
- {
- private:
- T data;
- public:
- ....
- };
-
- This should give you the implementation control you are seeking. I can see
- interfacing issues being a problem - you will need to ensure that the
- interfaces to the classes used as T in the template are similar (if not
- identical) or you're going to have trouble.
-
- FYI, Borland's 3.x C++ products have a class library with template
- implementations that do what you want. If you want me to post some details
- on the net, e-mail me, and I'll post an article on how they go about it.
- Warning: it's NOT trivial!
-
- My 2p worth
-
- Michael
-
- = Michael John Marshall - michael@xon.co.uk = B0ftg+k-s(+)h-r-
- = X-ON Software - 21 Great Tower St, London EC3R 5AQ ENGLAND
- = H 071 281 7056 - W 071 522 0088
- = Last night I played poker with a deck of Tarot cards -
- = I got a full house and four people died - Steven Wright
-