"Greg Comeau" <> wrote in message
news:bdir76$shh$...
> In article <>,
> Victor Bazarov <> wrote:
> >"Ron Natalie" <> wrote...
> >> "Yu Cao" <> wrote in message
> >news:bdfvj6$pgq$...
> >> > Q2. For a POD type, is operator new[] allowed to take non-default
> >> > initializers? Example:
> >> >
> >> > int* p = new int[100](1); // LINE AA
> >>
> >> What you wrote above is illegal for ANY type.
> >> >
> >> > Q3. For a POD type, should the following two statements both perform
> >> > zero initialization:
> >> >
> >> > int *p = new int[100]; // LINE BB
> >> > int *p = new int[100](); // LINE CC
> >>
> >> The latter is ILLEGAL.
> >
> >Really? How would you explain that it works in Comeau? Another
> >"****ed-up Comeau extension"?
>
> Just so there is no confusion, I labelled the above statements.
> LINE BB and LINE CC are both valid, legal, and well-defined,
> and usually mean different things. LINE AA is not allowed.
The whole idea for my "Really" was to coerce Ron into looking it
up in the Standard in an attempt to make him substantiate his
claims. It has become customary here (in response to some newbies'
"it works this way here so it's right" statements) to actually
quote the Standard (not that it has the desired effect every time),
so I would expect both Ron and you not to use "it's legal" or "it's
ILLEGAL" without proof. And, mind you, *I* don't need that proof,
most of the time. It's the other posters who read the forum I am
concerned about.
Victor