|
Boost : |
From: Martin Bonner (Martin.Bonner_at_[hidden])
Date: 2008-02-14 13:06:51
----Original Message----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of Sebastian Redl
Sent: 14 February 2008 17:59 To: boost_at_[hidden]
Subject: Re: [boost] [String algorithm] is_any_of hasinefficient
implementation
> Phil Endecott wrote:
>> Further investigation with other workloads suggests that this bitset
>> really works very well, and I note that it would be possible to
>> write a specialisation of std::set<char> using it. This is probably
>> worth pursuing.
>>
> You can't specialize std::set<char> this way. It loses ordering.
Why does it lose ordering? If I add 'b' and 'a' and then iterate over
the set, I would expect the specialization to return 'a' and then 'b'
(because it would find the bit corresponding to 'a' set before the bit
corresponding to 'b').
Of course WE can't specialize std::set<char> this way, but an
implementor could.
-- Martin Bonner Senior Software Engineer/Team Leader PI SHURLOK LTD Telephone: +44 1223 441434 / 203894 (direct) Fax: +44 1223 203999 Email: martin.bonner_at_[hidden] www.pi-shurlok.com disclaimer
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk