
----Original Message---- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Sebastian Redl Sent: 14 February 2008 17:59 To: boost@lists.boost.org 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@pi-shurlok.com www.pi-shurlok.com disclaimer