Fridrich Strba schrieb:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> You used a version of std::sort that assumes that the types that are
> compared do has operator< defined. This is not the case for
> rtl::OUString. Just wondering why this compiled.
> 
> I would suggest you that you create a function object that will do the
> less-then comparison and that you use the second version of std::sort
> explained here http://www.sgi.com/tech/stl/sort.html
> 
> As usual, my comment can demonstrate itself completely pointless, so it
> is good to take it as such.
> 
Hi Fridrich,

I am a little bit confused as rtl::OUString provides an operator< as the
code from Shizhoubo works. See the declaration/implementation from
ustring.hxx below)

friend sal_Bool operator < ( const OUString& rStr1, const OUString&
rStr2 ) SAL_THROW(()) { return rStr1.compareTo( rStr2 ) < 0; }

Besides that you are right that a function object (functor) makes sense
as we don't want to use the built-in less-operator as it's not I18N
aware. That's why the original code uses vcl::I18nHelper to compare the
strings.

Regards,
Carsten

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to