Abraxas/Meyers: Effective C++  Home  Table of Contents

Module - m10.html

ABRAXAS SOFTWARE - CodeCheck Meyers: Effective C++ Test-Suite

Meyers: Effective C++ Test Suite for Module - m10.cpp

// Item 10: Have assignment operators return a reference to *this. 52

this. 52
class Widget {
public:
	Widget();
	~Widget();
 Widget& operator=( const Widget& rhs )
 }



Function Name: operator=()

 {
	 return *this;		// good
};
class Widget {
public:
	Widget();
	~Widget();
 Widget& operator=( const Widget& rhs )
 }



Function Name: operator=()

 {
	 return  (rhs) ;		// rule 10
};

Abraxas/Meyers: Effective C++  Home  Table of Contents

ABRAXAS SOFTWARE - CodeCheck Meyers: Effective C++ Test-Suite