About SwSortedObjs

Miklos Vajna vmiklos at collabora.co.uk
Sat Mar 22 06:08:46 PDT 2014

Hi Julien,

On Fri, Mar 21, 2014 at 06:15:24PM -0700, julien2412 <serval2412 at yahoo.fr> wrote:
> Of course, the pb is std::set doesn't have [] operator and needs an iterator
> + advance (or perhaps missed an easy way?) However, leafing through the use
> of SwSortedObjs (used by other classes) it seems that [] is mainly
> (exclusively?) used in loops.
> So to make things easier to migrate (if it worths it of course! :-)), what
> about this 3 steps process:
> 1) Adding an iterator in  SwSortedObjs (quick)
> 2) use iterator in loops (must be long)
> 3) replace vector by set (perhaps not too quick if tuning is needed)
> ?

Isn't the difference between std::set and std::map that the key is
separated from the value, i.e. it has an operator[] what you want here?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140322/35e5f71e/attachment.sig>

More information about the LibreOffice mailing list