diff --git a/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.cpp b/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.cpp index f325556f64..70084c4def 100644 --- a/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.cpp +++ b/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.cpp @@ -44,6 +44,13 @@ StringPairArray& StringPairArray::operator= (const StringPairArray& other) return *this; } +void StringPairArray::swapWith (StringPairArray& other) +{ + std::swap (ignoreCase, other.ignoreCase); + keys.swapWith (other.keys); + values.swapWith (other.values); +} + bool StringPairArray::operator== (const StringPairArray& other) const { for (int i = keys.size(); --i >= 0;) diff --git a/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.h b/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.h index 8a46266ff7..a3acd993ec 100644 --- a/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.h +++ b/Subtrees/beast/modules/beast_core/text/beast_StringPairArray.h @@ -49,6 +49,9 @@ public: /** Copies the contents of another string array into this one */ StringPairArray& operator= (const StringPairArray& other); + /** Swap the contents of this array with another. */ + void swapWith (StringPairArray& other); + //============================================================================== /** Compares two arrays. Comparisons are case-sensitive.