Rethinking... (Re: RFC: fp printing speedup...)
Martin Sebor
sebor@roguewave.com
Fri Nov 14 17:31:00 GMT 2003
Martin Sebor wrote:
...
>>> Well, wait. What if ctype.widen looked like:
>>>
>>> CharT widen(char) {
>>> if (!cache) {
>>> cache = getcache();
>>> do_widen(cache.CharTarray, cache.chararry);
>>> }
>>> return cache.CharTarray[char];
>>> }
Whoops, I just now noticed that you're calling the array form from the
non-array form. That's definitely not what the standard now requires.
Hmmm, the result should still be the same but since the functions are
allowed (or, AFAIK, are not disallowed to) have side-effects I don't
think the above would be kosher.
FWIW, this is another one of the inconsistencies caused by the virtual
functions I was referring to earlier, although this one is even more
wicked.
Martin
More information about the Libstdc++
mailing list