Essentially, what's the difference between:
const Date& default_date()
{
static Date dd(2001,Date::Jan,1);
return dd;
}
and
const Date default_date()
{
static Date dd(2001,Date::Jan,1);
return dd;
}
Does the function signature really matter? I don't think of Date& as a type like *Date, so I'm not sure what difference this makes. Does it just prevent a copy from being made on the return? But then wouldn't you return &dd?