Prototypes are different:
juce_OwnedArray.h
template <typename ElementComparator>
int indexOfSorted (ElementComparator& comparator, const ObjectClass* const objectToLookFor) const noexcept
juce_Array.h
template <typename ElementComparator, typename TargetValueType>
int indexOfSorted (ElementComparator& comparator, TargetValueType elementToLookFor) const
I’m trying to use OwnedArray::indexOfSorted with an ElementComparator declared like this:
struct Compare
{
static int compareElements (Component* lhs, Handler* rhs)
{
return rhs->getComponent () - lhs;
}
};