Re: array size known/not known in compile time
Alf P. Steinbach wrote:
* Gabriel Dos Reis:
I'm not sure I would rate "long long" as terrible as VLA. Here, I think
there is a degree that call for appreciation.
I'm less worried by the extraordinary imaginative "long long" than the
Camel Nose of VLAs.
It would be nice if someone could explain exactly what's so terrible.
Almost against my will I'm now acting kind of like an advocate for VLA,
because a lot of comments have hinted at some catastrophic problem, but
with no substance to back that up: shades of FUD.
Nobody's saying that it's terrible. To tell the truth, I'm in
favor of it myself. But like all new extensions, especially
those touching the type system, there are a lot of little
details which take working out. Which means some investment in
time and effort. And to date, except for a warm, fuzzy feeling
of better C compatibility, no one has been able to give any
real, concrete advantages: what do we get in return for the
investment in time and effort? So while I would rather like to
see it in the next version of the standard, it doesn't mean
enough for me to be willing to invest the time and effort
necessary.
So I'm criticizing the critique, but apart from the stack
blowing up, which it can for any unreasonable usage, I've yet
to see the /real/ argument, if any?
It means that sizeof is no longer guaranteed to be an integral
constant. It means that there are certain classes you cannot
inherit from. (I suppose---I don't see how inheritance can be
made to work if the base class ends with a VLA.) It affects
function overloading. And probably a few other things.
That doesn't mean that it isn't doable. Far from it---I don't
think that the effort is overwhelming. But given the absence of
any positive motivation, no one seems ready to invest even the
modest amount of effort needed.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]