Rethinking... (Re: RFC: fp printing speedup...)
Paolo Carlini
pcarlini@unitus.it
Sat Nov 15 05:27:00 GMT 2003
Jerry Quinn wrote:
> > -5- It is unspecified whether the array form of each virtual
> > member function calls the single-element virtual overload
> > of the same function in a loop, or whether the single
> > element form calls the array form with an array of a single
> > element with the value of its argument, or whether neither
> > form calls the other. In any case, an implementation is not
> > permitted to call the other form of any virtual member
> > function overridden in a derived class.
>
> There's no way to tell that the virtual member is overridden, is
> there? This clause seems to say that neither form may call the other,
> period. I think that's what you have to do to solve the infinite
> loop, right? If so, how about:
>
> -5- Neither the array nor single-element form of virtual member
> function may call the other form.
This seems to me too strong and, if I understand well, would rule out
Martin's implementation (toward the end):
http://gcc.gnu.org/ml/libstdc++/2003-11/msg00159.html
;)
To achieve the same result (avoid unexpected endless loops) can't we
just say in -5- that, if one form is overridden, the other must be
(consistently) overridden too or undefined behavior is expected?
Is *this* too strong, in a different way? I don't know, but really,
that 12988 is missing the other form is at the root of the whole
discussion thread, in my opinion...
Paolo.
More information about the Libstdc++
mailing list