Group: comp.lang.c++
From: Jerry Coffin
Date: Saturday, April 12, 2008 8:52 PM
Subject: Re: Help add commas to int on console output

In article @b64g2000hsa.googlegroups.com>, james.kanze@gmail.com says...
> On 11 avr, 19:25, Jerry Coffin wrote:

[ ... ]

> > True -- I'm pretty sure that's a historical matter though.
>
> Maybe. But the locale stuff is a pure invention of the
> committee; it didn't exist before, so backward compatibility was
> no issue. And the locales don't mind using char* elsewhere
> where string would really be more appropriate, e.g.
> ctype<>::toupper.

Oh, I don't mean history before the standardization effort -- only
during it.

[ ... ]

> Changing std::string to std::vector certainly wouldn't
> have delayed the standard,

By itself, no -- except that doing so would have reopened the whole
subject of locales, and I can hardly imagine a way to even discuss them
without leaving somebody (usually quite a few somebodys) quite rightly
feeling that their needs are being slighted or ignored completely.

Don't get me wrong: when C was new, even mandating that a character set
have both lower- and uppercase English characters was asking for a lot
(and, in fact, C89 didn't mandate it). Given those meager beginnings, I
think they've done an almost amazing job of grafting some degree of
support of I18n on long after the fact. Nonetheless, it is grafted on
and (as I'm sure you know better than I) for almost anybody outside the
US, things can get clumsy in a hurry. Heck, even for us inside the US,
things get clumsy in a hurry -- in fact, the original subject of this
very thread applies equally in the US as elsewhere.

The bottom line is that I'm reasonably certain that if the subject of
locales had been reopened at all, it would have been almost impossible
to just agree to use std::vector where appropriate, and leave it at
that. As to why they didn't use std::string elsewhere, I can't say for
sure, though as I recall Andrew Koenig once explained that passing an
std::string as the name of a file to open wasn't added because it led to
discussions of I18N of file names that nobody felt could be resolved at
that point, so it was dropped entirely. I suspect (even if it was never
made official) that much the same thinking went into deciding to just
leave locales as they were, and be done with it.

--
Later,
Jerry.

The universe is a figment of its own imagination.

Safety Articles | Usenet Groups | 20lbs in 30 days