From -4937988359786011704
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,f1dec9ce20a9c98f
X-Google-Attributes: gidf78e5,public
From: fjh@cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: null pointers (was: Why's of C++ -- Part 1)
Date: 1999/08/16
Message-ID: <7p8g2f$ff7$1@mulga.cs.mu.OZ.AU>#1/1
X-Deja-AN: 513425967
X-Nntp-Posting-Host: murlibobo.cs.mu.oz.au
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <7opqvm$vpa$1@news.hal-pc.org> <7p0mu0$36f$1@mulga.cs.mu.OZ.AU> <FGEw80.FB0@research.att.com> <37B48FBA.2DE77379@tribble.com> <FGGtEt.8zG@research.att.com>
Organization: Computer Science, The University of Melbourne
X-UID: 0000000001
X-Status: $$$T
Newsgroups: comp.std.c++
Originator: clamage@taumet


bs@research.att.com (Bjarne Stroustrup) writes:

>From: David R Tribble <david@tribble.com> writes:
>
> > But '(void*)0' could have been deemed a special case in C++, so that
> > it would be treated like a true generic null pointer constant, and
> > not simply as a pointer-to-void.  This special case could have been
> > made without opening up the while void* type hole.
> > 
> > Given this special handling of '(void*)0', all of the statements
> > above would still be illegal, but the following statements would now
> > be legal in both C and C++:
> > 
> >     char * pc = (void*)0;
> >     void * pv = (void*)0;
> >     int *  pi = (void*)0;
> > 
> > The benefit of this approach over other proposal (such as adding
> > a 'null' or '__null__' keyword, or inventing new syntax like '&0')
> > is that it doesn't affect any existing C++ or C code.  It's also a
> > pretty trivial change to make to the standard.
>
>However, nobody considered the issue important enough to do
>the work of presenting and analysing the alternatives and presenting a
>specific and detailes proposal.

I thought James Kanze did make a specific and detailed proposal along these
lines to the C++ committee.  (I don't know whether his proposal presented
or analyzed the alternatives.)

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3        |     -- the last words of T. S. Garp.


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




