Boost logo

Boost Users :

From: Pavol Droba (droba_at_[hidden])
Date: 2005-07-16 13:53:37

On Sat, Jul 16, 2005 at 08:11:45PM +0200, Matthias Kaeppler wrote:
> Hi Pavol,
> > There is no such a function in string_algo lib. But you can easily use
> > std::lexicographical_compare.
> >
> > There is a variant with a custom comparison predicate. For that you can use
> > boost::is_iequal defined in boost/algorithm/string/compare.hpp.
> According to this paper ( by Matt
> Austern, using lexicographical_compare (alone) is not a good idea,
> because it doesn't take locales into account and thus case conversion
> may be incorrect.
> He proposed a solution in this article, but since Matt Austern has
> already contributed to Boost, I thought this functor might already be
> part of the Boost libraries.

Well I dare to say that the solution I have proposed to you is correct.
I'm fully aware that the case-conversion is locale awere. If you have
a look at the boost::is_iequal predicate, you will see that it takes a locale
as an agrument.

If you provide correct locales, the comparison will be correct as well.
Actualy it is exactly the solution proposed in the paper you mentioned.

Best regards,

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at