1.C++对传参合传返回值时构造的优化处理
#include
<
iostream
>
using
namespace
std;
class
Date
{
public
:
Date(
int
year = 1990,
int
month = 1,
int
day = 1)
{
}
Date(
const
Date& d)
{
cout<<
"Date(const Date& d)"
<<endl;
}
~Date()
{
cout<<
"~Date()"
<<endl;
}
private
:
int
_year;
int
_month;
int
_day;
};