On May 5, 2013, at 7:33 PM, Howard Hinnant
On May 5, 2013, at 2:45 PM, Vicente J. Botet Escriba
wrote: One possibility (untested) would be to make calculate_year a namespace scope function with the following default implementation:
year calculate_year(ymd_field_type ymd) {return ymd.year();}
So if the serial date will implicitly convert to ymd_filed_type, then you can say:
if (ymdTargetDate.month() == calculate_month(date))
And if an implementation thinks they can do better than that then they can overload calculate_xxx(serial_type). This is very analogous to how we currently handle swap.
Agreed it would be nice to find a better (shorter) name, but one hasn't immediately come to mind.
get_month? ___ Rob (Sent from my portable computation engine)