typedef enum{
Adjust_mode_None = 0,
Adjust_mode_H_min,
Adjust_mode_H_max,
Adjust_mode_S_min,
Adjust_mode_S_max,
Adjust_mode_V_min,
Adjust_mode_V_max
}Adjust_mode;
and at some point I want to do:
adjust_mode_ = (adjust_mode_+1)%7;
but I get
Invalid conversion from int to Adjust_mode
This is ok in other languages, what is wrong in C++? Do I need to define some operator?
use static_cast. You need an explicit conversion.
adjust_mode_ = static_cast<Adjust_mode>(adjust_mode_+1)%7;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With