Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bywater!scifi!watson!blinn.watson.ibm.com!mittle From: mittle@blinn.watson.ibm.com (Josh Mittleman) Newsgroups: comp.lang.c++ Subject: Re: How to define a List class Message-ID: <1991Jun07.164812.18340@watson.ibm.com> Date: 7 Jun 91 16:48:12 GMT References: <350001@hpgnd.grenoble.hp.com> Sender: @watson.ibm.com Organization: IBM T. J. Watson Research Lines: 18 > My problem is that "next" holds (or returns) a pointer to a List, not to > a SomeListableObject, i.e. the above code won't compile, unless I > introduce a cast like: > > list = (SomeListableObject*)list->next; > > Is there a solution that avoids that cast and which doesn't use the > preprocessor ? No. That's why everyone is so pleased at the advent of templates. A question for the general audience: Will templates as implemented in v3 duplicate code? =========================================================================== Josh Mittleman (mittle@watson.ibm.com or joshua@paul.rutgers.edu) J2-C28 T.J. Watson Research Center, PO Box 704, Yorktown Heights, NY 10598