Why compiler doesn't return error if operator+()
member function of date
class is not returning anything. if i do
date d1,d2;
date any = d1 + d2;
then d1 + d2
will create a temporary, what does this temporary gets initialized with?
date operator+(date d)
{
day += d.day;
month += d.month;
year += d.year;
}
Note: its just for test purpose only. Not for commercial use or anything.