I was experimenting bit with a c++ then I stumbled upon this problem:- binary '<<': no operator found which takes a right-hand operand of type 'c1'
What is causing such problem?
using c1 = enum class Color : unsigned int {
red,
green,
blue,
};
int main()
{
c1 col{ Color::red };
std::cout << "Value of col is " << col;
}
when I use enum followed just the name Color it prompts an warning:-
The enum type 'Color' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).