On Thu, 12 Jul 2001, Bruno Haible wrote:
> > In C++, is there a deprecated conversion to a pointer to a
> > non-const-qualified type?
>
> No. This conversion to 'char *' exists in C++ only because some
> functions like exec() take 'char *' arrays.
Why does C++ also have a conversion from wide strings to wchar_t *, then?
> > with narrow strings; with wide strings; and what sort of strings
> > result?
>
> This is weird; "a" L"b" is invalid, right?
In C89 and C++ it is undefined behavior; in C99 it is allowed and the
multibyte string is converted to wide. But there is some confusion in the
C standard about exactly how the concatenation is supposed to work here
(e.g. see WG14 reflector sequence numbers 8797, 8802, 8811, 8821, 8826).
> The effect cannot be achieved by pure macrology. But it makes sense to
> activate it only if 'u' is *not* defined as a macro.
With macros in a <unicode.h> header rather than defining a syntax for
source files to use directly, you could allow u"..." to be obtained by
concatenation (##) only and not affect the lexing of existing valid
programs. I don't like the lexing here being dependent on whether u is a
macro.
--
Joseph S. Myers
[EMAIL PROTECTED]
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/