From -7745185006595221260
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,f86cdbd4280bf4a1
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-11-10 01:25:55 PST
Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!news.sprintlink.net!EU.net!ub4b!btmplq.god.bel.alcatel.be!sebb.bel.alcatel.be!jvsb
From: jvsb@sebb.bel.alcatel.be (Johan Vanslembrouck)
Newsgroups: comp.std.c++
Subject: Re: Bytes and Characters
Followup-To: comp.std.c++
Date: 10 Nov 1994 08:07:43 GMT
Organization: Alcatel Bell Telephone, Antwerpen, Belgium
Lines: 80
Distribution: world
Message-ID: <1994Nov10.090121@sebb.bel.alcatel.be>
References: <JASON.94Oct17172312@phydeaux.cygnus.com> <KANZE.94Nov8192744@slsvhdt.us-es.sel.de>
Reply-To: jvsb@sebb.bel.alcatel.be (Johan Vanslembrouck)
NNTP-Posting-Host: btmpcf.sebb.bel.alcatel.be

Unread news in comp.std.c++ 
In article <slsvhdt.us-es.sel.de>, kanze@us-es.sel.de (James Kanze
US/ESC 60/3/164 #71425) writes:
|> In article <39a79t$87h@tethys.otol.fi> tohoyn@janus.otol.fi (Tommi
|> H|yn{l{nmaa) writes:
|> 
|> |> James Kanze US/ESC 60/3/164 #71425 (kanze@us-es.sel.de) wrote:
|> |> : In article <1994Oct25.144408.21066@datascope.com>
sfc@datascope.com
|> |> : (Steve F. Cipolli (P/M)) writes:
|> 
|> |> : |> Also, while were on this topic, has anyone continued the
fight to make "nil" a
|> |> : |> legitimate keyword; thus removing ambiguity like this:
|> |> [text deleted]
|> 
|> |> : I made a proposal along these lines.  It was not accepted.
|> 
|> |> What about
|> |> #define nil ((void*)0)
|> 
|> As other posters have pointed out, it doesn't work.
|> 
|> One of the reasons given for not accepting the proposal was that it
|> could be simulated by a template class, something along the lines
of:
|> 
|> 	template< class T >
|> 	class Nil
|> 	{
|> 	public :
|> 	    operator T*() { return 0 ; }
|> 	} ;
|> 
|> and then writing things like:
|> 
|> 	char* p = Nil< char >() ;
|> 
|> I recently tried to experiment with this.  Although I finally gave
it
|> up because of a compiler bug (my compiler will not instantiate a
class
|> template if its use is as an explicite constructor call), I was able
|> to play around with it long enough to find a major flaw: it is *not*
a
|> constant expression, and so initialization takes place at a later
|> point in time than one would expect.

My compiler complains too, unless I add a definition of
a default constructor:

		Nil() { }

to the template class definition.
Or is this something you try to avoid? (Sorry, your comment is not
clear
to me.)

|> Still, I would have liked to have been able to experiment a little
bit
|> more.
|> -- 
|> James Kanze      Tel.: (+33) 88 14 49 00     email:
kanze@lts.sel.alcatel.de
|> GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg,
France
|> Conseils en informatique industrielle --
|>                               -- Beratung in industrieller
Datenverarbeitung
|> 
|> 


-----------------------------------------------------------------------
Johan Vanslembrouck - SE99            Tel    : +32 3 2407739
Alcatel Bell Telephone                Telex  : 72128 Bella B
Francis Wellesplein  1                Fax    : +32 3 2409932
B-2018 Antwerp                        e-mail : jvsb@sebb.bel.alcatel.be
Belgium                                                               
-----------------------------------------------------------------------


