Download User's Guide
Transcript
Item ecpp_17
Items Enforced
Item ecpp_17
Check for assignment to self in
operator=
CodeWizard checks your code for aliasing in assignment operators.
Errors are marked as violations of Item ecpp_17.
Reason for rule: Not checking for assignment to self in operator= can
free resources that might be needed during the process of allocating new
resources. Checking for assignment to self may also save you a lot of
work that you would otherwise have to do to implement assignments.
Example
/*
* Item 17 - Check for assignment to self in operator=
*/
class A{
public:
A() {}
A& operator=(A& a)
// ECPP item 17 violation
{
_i = a._i;
return *this;
}
private:
int _i;
};
int main()
{
85
Related documents
User's Guide
RuleWizard User's Guide
3-Heights™ PDF Printer Service, User Manual
User's Guide
Getting Started with the CodeVisionAVR Extension for Atmel Studio
CodeVisionAVR revision history
Manual - Potter Electric Signal Company, LLC
Pulse Width Modulation
INFINITI - NISSAN - Advanced Diagnostics USA
Załącznik nr 6 do ZW 15/2007
LOGGER ver.4.1. - USER MANUAL