Boost logo

Boost Users :

Subject: Re: [Boost-users] General C++: Class Method Signatures Miss-Match
From: Dan Day (coolmandan_at_[hidden])
Date: 2009-05-01 11:32:27


On Fri, May 1, 2009 at 9:35 AM, Dominique Devienne <ddevienne_at_[hidden]> wrote:
> On Fri, May 1, 2009 at 9:22 AM, Etienne Philip Pretorius
> <icewolfhunter_at_[hidden]> wrote:
>> namespace unicode {
>>    typedef std::size_t code_point;
>>    class string : public std::basic_string<code_point> {
>>
>> Is "std::basic_string<unsigned int, std::char_traits<unsigned int>,
>> std::allocator<unsigned int> >" not the same as "unicode::string"? If not
>> why is it not?
>
> Not strictly related to your question, but Unicode code points use a
> maximum of 21 bits currently (max code point is 0x0010FFFF), and are
> unlikely to ever overflow a 32-bit integer. Whereas size_t will be
> 64-bit when compiling for a 64-bit architecture, so you want to
> typedef unicode::code_point to unsigned int anyway. --DD

Wouldn't then the OP rather use uint32_t or similar? I thought that
int represented the natural word size of the architecture. If so, then
wouldn't unsigned int be 64-bit on a 64-bit platform as well? Or did I
miss something?

-- 
Dan Day

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net