Boost logo

Boost :

From: Drazen DOTLIC (Drazen.Dotlic_at_[hidden])
Date: 2003-07-21 06:44:55


OK, no answer, let me rephrase my question...

In the state it is now, lexical_cast is usable only in 1 (one!) Unicode
scenario under Windows* - using latest MS compiler (Visual Studio .NET
2003 a.k.a. VC 7.1) AND defining compiler switch /Zc:wchar_t (or even
stronger /Za) which would treat wchar_t as native type and not a typedef
to something (usually unsigned short). The reason is one simple #ifdef
at the top of lexical_cast header which prohibits usage of wide
characters unless wchar_t is native type (plust few other restrictions,
but they seem fine).
Now, I can see the reasoning for this - if lexical_cast includes other
boost headers that NEED to make distinction between "real" wchar_t and
"fake" (typedef) one then guarding this way is indeed desirable (I can
provide examples where things break if anyone is interested).

At the same time, due to sheer complexity of my company's product, and a
lot of 3rd party open source components we use, we are unable to
properly treat wchar_t as a type, even though we do use VC7.1 and
theoretically are able to do so.

But, due to the fact that lexical_cast includes just a few boost
headers, none of which is affected by wchar_t being native type or not,
why not get rid of dependency on wchar_t being native type (when using
MSVC only of course)? I tried it and had no problems.

So, the change I propose is the following - replace
#if defined(BOOST_NO_STRINGSTREAM) || \
    defined(BOOST_NO_STD_WSTRING) || \
    defined(BOOST_NO_STD_LOCALE) || \
    defined(BOOST_NO_INTRINSIC_WCHAR_T)
#define DISABLE_WIDE_CHAR_SUPPORT
#endif

With something like this

#if defined(BOOST_NO_STRINGSTREAM) || \
    defined(BOOST_NO_STD_WSTRING) || \
    defined(BOOST_NO_STD_LOCALE) \
#if !defined(BOOST_MSVC)
    || defined(BOOST_NO_INTRINSIC_WCHAR_T)
#endif
#define DISABLE_WIDE_CHAR_SUPPORT
#endif

Any comments this time? Is it possible that nobody does Unicode builds
(or that all that do use latest compiler and right switch)?

Thanks for any comment in advance,

Drazen

*I am deliberately ignoring possibility of using other compiler than MS
for various reasons not so much relevant to this topic.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk