Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++ Subject: Re: solution to implementing parameterized classes Message-ID: <762@taumet.com> Date: 12 Jun 91 15:57:58 GMT References: <1991Jun9.013306.4462@cs.sfu.ca> <1991Jun9.204515.18040@ms.uky.edu> <25349@well.sf.ca.us> <1991Jun11.183133.11458@auto-trol.com> Organization: Taumetric Corporation, San Diego Lines: 23 mattel@auto-trol.com (Matt Telles) writes: >In article <25349@well.sf.ca.us> nagle@well.sf.ca.us (John Nagle) writes: >> As does the notion that "(void *)" should be a normal part of programming. >> John Nagle > FINALLY! Someone else that dislikes the idea of a pointer to nothing ... >Can't we define a type called generic???? (You know, like a generic pointer). Absolutely!! In fact, we can do this without any changes to the language: typedef void * generic_ptr; Now we can write things like generic_ptr memchr(const generic_ptr ptr, int val, size_t len); which makes it crystal-clear that we are working with generic pointers, not with "pointers to nothing". This is certainly much, much better than having to learn the complicated rule that "void*" means "generic pointer". -- Steve Clamage, TauMetric Corp, steve@taumet.com