home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_07_06
/
v7n6034a.txt
< prev
next >
Wrap
Text File
|
1989-07-25
|
512b
|
20 lines
// CI.CXX: An example of the copy-initializer
// being used for initialization.
class ci {
int i;
public:
ci(int j) { i = j; }
// copy-initializer:
ci(ci & rv) {
puts("copy-initializer called");
i = rv.i; // copy in the rvalue
}
};
main() {
ci original(1);
ci copy1(original); // copy-initializer called.
ci copy2 = original; // here, too
}