Browse Source

Template changes to some array sort methods.

tags/2021-05-28
jules 13 years ago
parent
commit
9821174709
2 changed files with 4 additions and 5 deletions
  1. +2
    -2
      modules/juce_core/containers/juce_Array.h
  2. +2
    -3
      modules/juce_core/containers/juce_OwnedArray.h

+ 2
- 2
modules/juce_core/containers/juce_Array.h View File

@@ -672,8 +672,8 @@ public:
@returns the index of the element, or -1 if it's not found
@see addSorted, sort
*/
template <class ElementComparator>
int indexOfSorted (ElementComparator& comparator, ParameterType elementToLookFor) const
template <typename ElementComparator, typename TargetValueType>
int indexOfSorted (ElementComparator& comparator, TargetValueType elementToLookFor) const
{
(void) comparator; // if you pass in an object with a static compareElements() method, this
// avoids getting warning messages about the parameter being unused


+ 2
- 3
modules/juce_core/containers/juce_OwnedArray.h View File

@@ -471,9 +471,8 @@ public:
@returns the index of the element, or -1 if it's not found
@see addSorted, sort
*/
template <class ElementComparator>
int indexOfSorted (ElementComparator& comparator,
const ObjectClass* const objectToLookFor) const noexcept
template <typename ElementComparator, typename TargetValueType>
int indexOfSorted (ElementComparator& comparator, TargetValueType objectToLookFor) const noexcept
{
(void) comparator;
const ScopedLockType lock (getLock());


Loading…
Cancel
Save