[Solved] C++ How can I access to an inner enum class?


P0W’s answer is correct on both counts, but in case you simply want to output the underlying value, then it may be simpler to cast rather than overload the insertion operator.

using enum_type = std::underlying_type<Apple::color>::type;
enum_type value = (enum_type)Apple::color::green;
std::cout << value << '\n';

2

solved C++ How can I access to an inner enum class?