Skip to main content Link Menu Expand (external link) Document Search Copy Copied

bool operator==(List& list)

Returns true if the lists values are all the same

Parameter

  • list - the list to compare the current list to

Returns

A boolean that is true if the lists hold the same values, false otherwise

Example

```cpp LinkedList list1 = {3, 4, 5}; LinkedList list2 = {3, 4, 5}; if(list1 == list2){ //This branch will be executed } list1.pushBase(2); if(list1 == list2){ //This branch will not be executed }