Please enable JavaScript.
Coggle requires JavaScript to display documents.
330/361 - iterators, adts, templates, big 3/big 5 - Coggle Diagram
330/361 - iterators, adts, templates, big 3/big 5
-
-
big 3
-
-
assignment operator
handles
assignment(makes it a deep copy, not a shallow copy)
-
-
optional
swap
copy-and-swap idiom
3 steps
- pass an object of the class youre working on by copy/value(instead of by reference like normal) to the assignment operator forcing it to call the copy constructor
- create a friend function named swap
- call the swap function within the assignment operator, forcing it to call the destructor implicity instead of having to use delete explicitly within the assignment operator
-
-