From 1171656105264162982
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,8372ae6de42be399
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2004-03-01 09:50:08 PST
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!cyclone.swbell.net!cyclone-sf.pbi.net!216.196.106.144!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!sjc70.webusenet.com!news.usenetserver.com!cyclone.bc.net!news.alt.net!comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ucar.edu
From: Michiel.Salters@cmg.nl (Michiel Salters)
Newsgroups: comp.std.c++
Subject: Re: Array of size 0
Organization: http://groups.google.com
Message-ID: <cefd6cde.0403010844.759e0950@posting.google.com>
References: <403601F6.8010706@ircad.u-strasbg.fr> <c15mlg$pdl$1@news1nwk.SFbay.Sun.COM> <m3y8qwp6uy.fsf@merlin.cs.tamu.edu> <Egr_b.78425$hR.1612895@bgtnsc05-news.ops.worldnet.att.net> <m37jybcq2j.fsf@merlin.cs.tamu.edu>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1078159493 29513 127.0.0.1 (1 Mar 2004 16:44:53 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 1 Mar 2004 16:44:53 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 2.60-mulga_r1 (1.212-2003-09-23-exp) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=0.0 required=5.2 tests=none autolearn=no 
	version=2.60-mulga_r1
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Date: Mon,  1 Mar 2004 11:45:57 CST
Lines: 27
Xref: archiver1.google.com comp.std.c++:1254

Gabriel Dos Reis <gdr@cs.tamu.edu> wrote in message news:<m37jybcq2j.fsf@merlin.cs.tamu.edu>...
> "Andrew Koenig" <ark@acm.org> writes:
> 
> | If new is permitted to return zero, then every call to new must have a
> | corresponding test (although it might be possible to combine multiple tests
> | into one).
> 
> But, I would not argue for new to return zero :-)  I would argue for
> whatever it returns, when it returns, be a dereferenceable value so
> that calls don't have to make the corresponding checks.

What's that got to do with new T[0]? Whatever new T[n] returns,
you can dereference only n Ts in that array, and (new T[n])+n is
a valid expression for a pointer you can't dereference. Adding
an exception so that new T[0] gives you 1 T* you can dereference
doesn't solve any of my problems.

Regards,
-- 
Michiel Salters

---
[ 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://www.jamesd.demon.co.uk/csc/faq.html                       ]



