Discussion:
About paramaters of Operators
(too old to reply)
Ioan Buzdugan
2003-11-29 22:10:24 UTC
Permalink
I was wondering whether we'll lose marks in A5 if the paramaters in our
operators (such as "+") are not const.
Daniel Wigdor
2003-11-30 07:30:26 UTC
Permalink
It is rather important that the parameters be "const" whenever possible. If
they're not, then they are likely modifying the objects, which is bad. The
one exception is the "<<" operator, which is not defined within the same
class, and thus has no access to private members. For the operators in A5,
you should definitely make the param's const.

Daniel
Post by Ioan Buzdugan
I was wondering whether we'll lose marks in A5 if the paramaters in our
operators (such as "+") are not const.
Loading...