Add comments for operator= in singlelist

This commit is contained in:
Shaun Reed 2020-04-26 22:19:34 -04:00
parent 110ac83be8
commit 23d1ce7b4a
2 changed files with 7 additions and 7 deletions

View File

@ -19,7 +19,7 @@ int main()
{
std::cout << "Driver: \n";
SingleList testList, test;
SingleList testList;
bool exit = false;
int choice = -1;
int val, key;
@ -41,7 +41,6 @@ int main()
std::cin >> val;
std::cin.clear();
testList.insert(val);
test = testList;
break;
case INSERTAT:
@ -68,7 +67,6 @@ int main()
case PRINT:
testList.print();
test.print();
break;
case FIND:

View File

@ -36,11 +36,13 @@ SingleList::SingleList(const SingleList& rhs)
}
}
/**
* @brief Shallow copy of the rhs into the lhs of the assignemnt
/** operator=
* @brief Assign two SingleList objects equal using copy constr and class destr
* Pass the rhs by value to create local copy, swap its contents
* Destructor called on previous SingleList data at the end of this scope
*
* @param rhs SingleList object
* @return SingleList& A shallow copy of the rhs SingleList in the assignment
* @param rhs SingleList object passed by value
* @return SingleList A deep copy of the rhs SingleList object
*/
SingleList SingleList::operator=(SingleList rhs)
{