當我在VS2010中運行此代碼時,不應用NRVO。 #include <stdio.h>
class A
{
public:
A() { printf("I am in constructor\n"); }
A(const A& a) { printf("I am in copy constructor\n"); }
~A() { printf("I
class Date
{
private:
int day,month,year;
public:
Date (int d,int m,int y)
{
day=d;
month=m;
year=y;
}
Date (Date &d)
{
day=d.day;
month=d.month;
year=d.year;
}
int monthDays(int mont