lecture 5-6: sets Flashcards
(10 cards)
What is a concern when passing large objects to a method/function?
Efficiency
What does call-by-value do when passing an object?
Makes a complete copy of the object
Why is call-by-value expensive for large objects?
Because it creates a complete copy of the object
What is the advantage of using const & when passing large objects?
No copy is done and const protects the argument from modification
What can const variable/parameters not do?
They cannot be changed
Define L-values in the context of assignment statements.
Variables/objects that can be on the left-hand side of an assignment statement
Can L-values be on the right-hand side of an assignment?
Yes
How can L-values be passed?
As reference or as value
Define R-values in the context of assignment statements.
Variables/objects that cannot be on the left-hand side of an assignment
How can R-values be passed?
By value or passed by const&