Wednesday, October 6, 2010

Make operator = returns a reference point to * this



"Effective C + +" Reading Notes 10: make operator = returns a reference point to * this

General chain assignment methods:

int x, y, z;

x = y = z = 15; / / is equivalent to x = (y = (z = 15));

When we are to achieve their own operator = operation, the need to return a reference, the reference point to the operator on the left of the parameter; 1 class Widget

2 (

3 public:

4

5 Widget & operator = (const Widget & rhs)

6 (

7

8 return * this; / / return * this

9)

10);

* This is why the c + + standard to achieve the standard practice of not doing so can also be compiled, but as is the norm, they observe about it.







Recommended links:



evaluation PIMS And Calendars



Open-source third-polar world



Collection ftp operation of common sense



Office Suites And Tools CATALOGS



"Want To" Match "can Do"



"Cockroaches door", HP will lose?



After the way you do business you're CONSIDERING?



Issues Related To The Domestic Domain



Simple Games Simulation



3G2 to WMV



3G2 to AVI



RMVB to MPEG



ie can not display fix these errors now



A domestic room, map DESCRIPTION IDC



John XINHUA Introduction Of Guangxi Sugar Set EAM2008



Write a custom TASK, easily extend Ant



Comment Download Managers



No comments:

Post a Comment