diff --git a/modules/juce_core/text/juce_StringArray.cpp b/modules/juce_core/text/juce_StringArray.cpp index 81407e60d7..d275fee02b 100644 --- a/modules/juce_core/text/juce_StringArray.cpp +++ b/modules/juce_core/text/juce_StringArray.cpp @@ -118,6 +118,11 @@ bool StringArray::operator!= (const StringArray& other) const noexcept return ! operator== (other); } +void StringArray::swapWith (StringArray& other) noexcept +{ + strings.swapWithArray (other.strings); +} + void StringArray::clear() { strings.clear(); diff --git a/modules/juce_core/text/juce_StringArray.h b/modules/juce_core/text/juce_StringArray.h index 6deb6c1f5b..f1d191b9cc 100644 --- a/modules/juce_core/text/juce_StringArray.h +++ b/modules/juce_core/text/juce_StringArray.h @@ -90,6 +90,9 @@ public: StringArray& operator= (StringArray&& other) noexcept; #endif + /** Swaps the contents of this and another StringArray. */ + void swapWith (StringArray& other) noexcept; + //============================================================================== /** Compares two arrays. Comparisons are case-sensitive.