Hi everybody I am working on a String project for my class and I'm stuck on this swap function. This is what my professor has in his "tests" :
void test_swap_first_shorter()
{
// Setup fixture
string foo("foo");
string barbar("barbar");
// Test
foo.swap(barbar);
// Verify
assert(foo == "barbar");
assert(barbar == "foo");
assert(foo.size() == 6);
assert(barbar.size() == 3);
}
and this is what I have in mine.
void string::swap(string first)
{
string second;
first.swap(second);
}
His way of assigning the projects are a little weird so I really don't understand what he's asking us to do here. Oh and when I go to run his make file, it slows down my computer so it's definitely doing something wrong. Thanks in advance.