Now we discuss the new C + + / CLI environment, a cool feature, called the proxy constructor.
A class, there are multiple constructors often do; and that this constructor has a number of common code is also very often. In general, in this case, we are prepared for the common code a separate function, and then placed in each constructor call. Following example: class Foo
(
private:
int _mem;
public:
Foo (): _mem (0)
(
CommonConstructor ();
)
Foo (int mem): _mem (mem)
(
CommonConstructor ();
)
Foo (const Foo & f): _mem (f._mem)
(
CommonConstructor ();
)
/ / We need all the constructor's code
void CommonConstructor ()
(
printf ("Constructing the object");
)
);
Recommended links:
Infomation Computer Education
DivX to MPEG
VMware opens Chinese name: VIA
Auto Attendant Computer Operator
A Reliable partner in a common cause
your first Electric bike tips for buying kits
News about PIMS And Calendars
Premier Backup And Restore
Qingdao Shengli Oilfield nursing home use Maxima
MP3 MP4 Manufacturers Staged Radical Transformation That Only Half Of
ASF to MPG
EU: RFID is Still unbalanced relationship between the pros and cons
Transport Stream converter
Taught you how to DB2 Patch
No comments:
Post a Comment