Boost logo

Boost :

Subject: Re: [boost] [Locale] Preview of 3rd version
From: Artyom (artyomtnk_at_[hidden])
Date: 2010-09-12 06:32:28


> Unfortunately, wchar_t is a different type from uint16_t or uint32_t,
> so what you are doing probably counts as breaking the strict aliasing rule.

C++0x char16_t and char32_t are define as

> Types _Char16_t and _Char32_t denote distinct types with the same size,
>signedness,
>
> and alignment as uint_least16_t and uint_least32_t,
> respectively, in <stdint.h>, called the underlying types.

So no problems there,

Now, wchar_t is very weakly defined so it can be any size, but de-facto it is
2 or 4 bytes integer value. So it is fine to cast it to other value of such
type,
all other possible sizes are not supported by Boost.Locale, and it would not
even
compile if it has different size.

So I don't see any possible issues there even on the paper it may not work.
That is my least problem, there are much bigger problems like crappy support
of locales by most C++ standard libraries.

Artyom

      


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