我有以下代码:
class mph {
public:
enum minute_periods {five, ten, fifteen, thirty};
std::vector<minute_periods> factors;
minute_periods fac;
void setUpFactors(void) {
factors.resize(4);
factors[five] = 5;
factors[ten] = 10;
factors[fifteen] = 15;
factors[thirty] = 30;
}
我收到以下错误:
error: invalid conversion from ‘int’ to ‘mph::minute_periods’
我如何解决它?