「view this page in B3 βῆτα server」

Revisions №58374

branch: master 「№58374」
Commited by: Andrew Leaver-Fay
GitHub commit link: 「47a12fd75243ae6b」 「№993」
Difference from previous tested commit:  code diff
Commit date: 2015-12-23 09:11:38

Merge pull request #993 from RosettaCommons/aleaverfay/make_assignment_ops_return_nonconst_refs Fixing ~60 assignment operators that returned const-references Assignment operators in c++ are, by convention, supposed to return non-const references to the underlying type. All of the assignment operators I have written up until now have returned const-references, however. My bad. This is, to my surprise, a bad thing. It violates the "principle of least surprise" (not to be confused with the principle of least surprise for Andrew) in making a class behave differently from a primitive. In C++ it's legal to take two ints, x and y and do this: ( x = y )++; This commit will fix the broken cppcheck test, and removes many complaints (that don't register as failures) that cppcheck makes about our assignment operators.

...