diff --git a/modules/juce_core/containers/juce_SortedSet.h b/modules/juce_core/containers/juce_SortedSet.h index bc1ab18a72..ec44ee81dd 100644 --- a/modules/juce_core/containers/juce_SortedSet.h +++ b/modules/juce_core/containers/juce_SortedSet.h @@ -531,6 +531,20 @@ public: } } + /** This swaps the contents of this array with those of another array. + + If you need to exchange two arrays, this is vastly quicker than using copy-by-value + because it just swaps their internal pointers. + */ + void swapWith (SortedSet& otherSet) noexcept + { + const ScopedLockType lock1 (getLock()); + const ScopedLockType lock2 (otherSet.getLock()); + + data.swapWith (otherSet.data); + swapVariables (numUsed, otherSet.numUsed); + } + //============================================================================== /** Reduces the amount of storage being used by the set. diff --git a/modules/juce_core/text/juce_StringArray.h b/modules/juce_core/text/juce_StringArray.h index f1d191b9cc..d64a45098a 100644 --- a/modules/juce_core/text/juce_StringArray.h +++ b/modules/juce_core/text/juce_StringArray.h @@ -125,6 +125,22 @@ public: */ String& getReference (int index) noexcept; + /** Returns a pointer to the first String in the array. + This method is provided for compatibility with standard C++ iteration mechanisms. + */ + inline String* begin() const noexcept + { + return strings.begin(); + } + + /** Returns a pointer to the String which follows the last element in the array. + This method is provided for compatibility with standard C++ iteration mechanisms. + */ + inline String* end() const noexcept + { + return strings.end(); + } + /** Searches for a string in the array. The comparison will be case-insensitive if the ignoreCase parameter is true.