🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #1508

Re: CW new intializer compile problem

#1508
From: Howard Hinnant
Date: Tue, 15 Aug 2000 00:00
44 lines
2539 bytes
In article <Frode.Nilsen-1508001004560001@129.241.250.12>,
Frode.Nilsen@mison.no (Frode Nilsen) wrote:

| Are you sure this is the intended interpretation of the standard ?

My specialty is the lib half of the standard, not the language half, so I
could very well be wrong.
 
| The heading for paragraph 15 is:
| "A new-expression that creates an object of type T initializes that object
| as follows:"
| 
| I don't think an array are considered as a separate type, just as a
| multiple of one type.
| 
| The mention of array in the other bullets are done in parantheses, not
| directly in the text. Just to make sure the reader understands that this
| includes arrays?
| I feel this then is implicit in bullet 3 and 4.
| 
| And since the form
| 
| long* item = new long( 0 );
| 
| is legal syntax, I find it strange that
| 
| long* array = new long[1024]( 0 );
| 
| should not be.

Section 3.9 enumerates the different types in C++.  Arrays are listed in
3.9.2/1/bullet 1.  So that's where I'm getting my notion of different
things that T could represent in 5.3.4. 
 
| Just my two cents.

Perhaps your question would make an appropriate post on comp.std.c++.  The
people that authored 5.3.4 will likely be there to give a more
authoritative answer.

FWIW, I also find it strange that the language allows for initializing an
array of longs to 0 (via the () syntax), but to no other value.

-Howard
Technical Details
Message-ID: <hinnant-1508000927290001@ith3-43a.twcny.rr.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <Frode.Nilsen-1008000847320001@129.241.250.12> <mwron-1008001327490001@c243286-a.bcreek1.mi.home.com> <Frode.Nilsen-1108000848450001@129.241.250.12> <mwron-1108001224050001@c243286-a.bcreek1.mi.home.com> <hinnant-1108001418200001@ith3-397.twcny.rr.com> <Frode.Nilsen-1508001004560001@129.241.250.12>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,2563d8ae05f01356,start
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,c8b271601d1fcba4
X-Google-Attributes: gidf635e,public
X-Google-Thread: fd047,2563d8ae05f01356,start
X-Google-Attributes: gidfd047,public
From: hinnant@anti-spam_metrowerks.com (Howard Hinnant)
Subject: Re: CW new intializer compile problem
Date: 2000/08/15
Message-ID: <hinnant-1508000927290001@ith3-43a.twcny.rr.com>
X-Deja-AN: 658518019
References: <Frode.Nilsen-1008000847320001@129.241.250.12> <mwron-1008001327490001@c243286-a.bcreek1.mi.home.com> <Frode.Nilsen-1108000848450001@129.241.250.12> <mwron-1108001224050001@c243286-a.bcreek1.mi.home.com> <hinnant-1108001418200001@ith3-397.twcny.rr.com> <Frode.Nilsen-1508001004560001@129.241.250.12>
X-Complaints-To: abuse@twcny.rr.com
X-Trace: typhoon.nyroc.rr.com 966345885 24.24.28.58 (Tue, 15 Aug 2000 09:24:45 EDT)
Organization: Metrowerks
NNTP-Posting-Date: Tue, 15 Aug 2000 09:24:45 EDT
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac,codewarrior.windows