"Improved Array efficiency" change broke some refcounted


I suspect the array improvements ‘broke’ sorting of a refcountedarray?

A previously fine sorter like this:

Now throws compile errors. This line in sortArray:

looks for a compareElements with (XmlDataItem& first, XmlDataItem& second), not the refcounted versions.

I suppose that, if the array were locked (it doesn’t seem to be), then the reference would work as well, but when I tried to change my comparator, it failed because I have a private copy constructor. (I know elements in an array need to be movable, but the ref counted ptrs are, not the actual item).

I browsed the GIT, and tried to remove the cast from this in the sort method:

I get no matching function. Any clues?



Sorry - stupid typo in the array. Should read:

        sortArray (comparator, (ObjectClass**) data.elements, 0, size() - 1, retainOrderOfEquivalentItems);

Am checking new stuff in shortly, and that’ll be in there.


I got it, brilliant, thanks.

Might be your record.

Thanks for taking the time away from working on the juce iPad port :smiley: