Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!pdn!tscs!tct!chip From: chip@tct.com (Chip Salzenberg) Newsgroups: comp.lang.c++ Subject: Re: Implementing NULL Message-ID: <28468FF0.44E5@tct.com> Date: 31 May 91 18:03:28 GMT References: <77091@brunix.UUCP> Organization: Teltronics/TCT, Sarasota, FL Lines: 21 According to sdm@cs.brown.edu (Scott Meyers): > class NullClass { > public: > template operator T*() const { return 0; } > }; > > extern NullClass NULL; This approach loses when NULL is used for a non-class pointer. For example, this code fragment won't work with NullClass: extern time_t time(time_t *t); main() { time_t t = time(NULL); } -- Chip Salzenberg at Teltronics/TCT , perl -e 'sub do { print "extinct!\n"; } do do()'