Add comments for operator= in singlelist
This commit is contained in:
parent
110ac83be8
commit
23d1ce7b4a
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue