Intel Core i7-3770 @ 3.40Ghz
Windows 7 Professional 64-bit
Visual Studio 2010 Version 10.0.40219.1 SP1Rel
#include <iostream>
struct C {
C() {}
C(const C&) { std::cout << "A copy was made.\n"; }
};
C f() {
return C();
}
int main() {
std::cout << "Hello World!\n";
C obj = f();
system("PAUSE");
return 0;
}
Depending upon the
compiler, and that compiler's settings, the resulting
program may display any of the following outputs:
Hello World!
A copy was made.
A copy was made.
Hello World!
A copy was made.
Hello World!
The console output is:
Hello World!
沒有留言:
張貼留言