From Wrox Press C++ Tutorials - Ivor Horton
If we had stored these simply as strings, as we did in Ex3_04.cpp, a great deal of copying would be necessary - we would need to copy the whole string 'Robert Redford' to a temporary location while we copied 'Oliver Hardy' in its place, and then we would need to copy 'Robert Redford' to the end position. This would require significantly more computer time to execute.
Not quite. std::string defines the member function swap, which has constant-time complexity. So:
Code:
std::string array[] = { "string1", "string2", "string3", "string4" };
array[1].swap(array[2]); // constant-time
std::swap(array[1], array[2]); // also constant-time, if not - complain to library vendor