"Pavol Droba"
On Sat, Jul 16, 2005 at 06:17:28PM -0500, Thore Karlsen wrote:
On Sat, 16 Jul 2005 18:46:33 +0200, Pavol Droba
wrote: ...
But is_iequal only tests for equality, it doesn't provide an ordering of the characters. He's looking for something like is_iless, which I think would be a nice addition too string_algo.
I see. Sorry about that. Somehow I have overlooked this obvious aspect.
You are right, such a function can be usefull. I will add it (but it will have to wait after the release)
Any thoughts on carrying this one step further. I've the case where I need not just case insensitivity, but more of an interleaved case sensitivity. For example using the following: int CompareInterleavedCaseChar( char a1, char a2 ) { if( std::toupper(a1) < std::toupper(a2) ) return -1; else if( std::toupper(a2) < std::toupper(a1) ) return 1; else if( a1 < a2 ) return -1; else if( a2 < a1 ) return 1; else return 0; } results in the following ordering: ABCdef ABcDef AbcDef Abcdef in other words A < a < B < b < C ... Thanks, Jeff Flinn