Boost logo

Boost :

From: Mac Murrett (mmurrett_at_[hidden])
Date: 2001-10-20 17:24:46


Michiel,

I assume that you mean the case in which charT is a reference to something
(i.e. long &). This is an interesting case (and one that I haven't given
much thought to), and obviously deserves a partial specialization. My
initial thoughts are as follows:

There are two reasons why one might want a packed string. These are (1)
storage efficiency and (2) duplication speed. Neither of these are real
advantages with references: as for (1), the charTs themselves are stored
elsewhere, and as for (2), a copy is just a matter of copying the references
themselves, which boils down to copying pointers. This is the case
regardless of the size of the data or how much of that size is used.

I therefore cannot think of a reason not to just make
boost::packed_string<charT &, used_bits, traits, Allocator> a fall-through
to std::basic_string<charT &, traits, Allocator>.

Comments?

Thanks,
Mac.

On 10/19/01 1:54 PM, "Michiel Salters" <Michiel.Salters_at_[hidden]> wrote:

> How do you plan to handle charT& ?
>
> Regards,
> Michiel Salters
>
>> -----Original Message-----
>> From: Mac Murrett [mailto:mmurrett_at_[hidden]]
>> Sent: Monday, October 15, 2001 7:54 PM
>> To: boost_at_[hidden]
>> Subject: [boost] Packed Strings?
>>
>>
>> There has been discussion on this list about 16- and 32-bit
>> Unicode strings,
>> as well as the fact that they need only be an awkward 21
>> bits. Has anyone
>> done any serious development yet on a generalized packed string (say,
>> boost::packed_string), one that would have the semantics of std::
>> basic_string, but would have special knowledge that only the
>> first n bits of
>> charT were used? Such a class would be useful for Unicode,
>> among other
>> things.
>>
>> Mac.
>>
>>
>> Info: http://www.boost.org Unsubscribe:
>> <mailto:boost-unsubscribe_at_[hidden]>
>>
>> Your use of Yahoo! Groups is subject to
>> http://docs.yahoo.com/info/terms/
>>
>>
>
> Info: http://www.boost.org Unsubscribe:
> <mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>


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