我有2个枚举值,我正在寻找一个接受1个枚举并返回另一个的函数
enum MonthLong{January = 1, February, March, April, June,July,August,September
,October,November,December};
enum Month{JAN = January, FEB, MAR, APR, MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC};
例如,函数将在JAN中获取并返回“January”。它必须通过以下BoostCHECK
static std::array<std::string const, 13> const names = { "", "January", "February", "March",
"April", "May", "June", "July", "August", "September", "October",
"November", "December" };
for (month_t i = JAN; i <= DEC; ++i)
BOOST_CHECK(gregorian_month_name(i) == names[i]);
我不确定如何编写函数gregorian_month_name