C++ definition of NULL

Jean-Pierre Radley jpr@jpr.com
Wed Mar 31 23:46:00 GMT 1999


Marc Espie averred (on Thu, Mar 04, 1999 at 03:32:17AM +0100):
| 
| The committee blew it: there should be another constant, a NIL or something,
| based on any sane pointer definition, like what Meyer writes at the end
| of Effective C++.   NULL needs to stay the way it is for compatibility with
| legacy code.

I use a NIL definition, with due credit, in some of my header files:

	/*  I prefer this NIL macro to present a NIL pointer than most other
	    variations that I have seen (eg, NULL, 0, or (cast) 0.
	    Comme ci, comme ca. - larry gensch
	*/
	#ifndef NIL
	# define    NIL(type)   (type *) 0
	#endif

-- 
Jean-Pierre Radley <jpr@jpr.com>  XC/XT Custodian   Sysop, CompuServe SCOForum



More information about the Gcc mailing list